66,418 questions
Best practices
1
vote
3
replies
65
views
How can I optimize my nodejs backend code for live data emiting for dashboard in UI
So I am working on a MEAN stack project where in node I will emit the data to UI and in frontend I had some widgets ( as charts like gauge , line , pie and table ) where user can add dynamically ...
Best practices
0
votes
5
replies
69
views
Is there a maximum value permitted in the struct timeval tv_usec field?
struct timeval contains two fields: tv_sec and tv_usec, which hold a count of seconds and microseconds respectively.
1000000 microseconds is a whole second. Is it permitted to populate the tv_usec ...
1
vote
1
answer
103
views
C# EasyHook SOCKET Connect
Based on my question C# IVI VISA (e.g.: NI VISA) TCP Keep Alive I tried to use EasyHook to patch how NI VISA is opening a SOCKET connection. Finally I would like to modify the keep alive settings in ...
0
votes
1
answer
93
views
Connection check failed: Error: Client network socket disconnected before secure TLS connection was established from Clichouse cloud service
Connection check failed: Error: Client network socket disconnected before secure TLS connection was established
Environment:
ClickHouse Cloud Service
Issue:
When trying to connect my application to ...
2
votes
1
answer
54
views
Incorrect report of SO_TIMESTAMP on macOS UDP socket with recvmsg()
I use the socket option SO_TIMESTAMP to get kernel timestamps on received UDP datagrams with recvmsg().
It works well on Linux, not on macOS. In practice, it seems that macOS does return the timestamp ...
0
votes
0
answers
52
views
MQL5 SocketConnect fails with error 4014 connecting to local TCP server
I’m developing an MQL5 Expert Advisor that should connect to a local TCP server (127.0.0.1:5001).
The server is running and responds correctly to Telnet.
In MetaTrader, I added 127.0.0.1:5001 in ...
0
votes
1
answer
82
views
Trying to get the message delivered to client, server is able to log the message
Server code is a socket accepting the request from curl and logging the byte info.
import socket
import selectors
import traceback
HOST = "0.0.0.0" # Listen on all interfaces
PORT = 8000 ...
3
votes
1
answer
194
views
Understanding socket() function args
I need to use socket() but the args given to the function make me confused.
I have to do an school exercice where I have to use socket for intercept ethernet frame (more specifically arp spoofing).
...
3
votes
1
answer
128
views
How to Shutdown the server using poll() Gracefully
I have written a database server and client, and i'm using a poll loop
#include <stdio.h>
#include <stdbool.h>
#include <getopt.h>
#include <stdlib.h>
#include <stdlib.h>
...
4
votes
1
answer
148
views
SCTP over UDP: Stop retransmission message
I'm trying to send SCTP messages over UDP. The setup appears to work, but I'm getting a retransmission message every time. Here's the process:
Create a new UDP socket()
bind() the socket to a local ...
1
vote
0
answers
92
views
TCP socket writable after connect but before ECONNREFUSED error
I'm using non-blocking TCP sockets on linux, and occasionally seeing the following pattern:
create the socket with socket() and set O_NONBLOCK
call connect (to a non-listening port), get -1 with ...
1
vote
0
answers
260
views
UdpSocket drops packets with low read_timeout
I'm using Rust's std UdpSocket to send data from one socket to another one locally.
It all works fine if I set no read timeout or if I set a "big" read timeout like 10ms. Once I set the ...
3
votes
3
answers
151
views
How to handle EINTR in connect()?
I'm trying to handle EINTR error from POSIX connect call. I'm running on OSX this connect code:
JNIEXPORT jint JNICALL Java_io_questdb_network_Net_connect
(JNIEnv *e, jclass cl, jint fd, jlong ...
0
votes
0
answers
66
views
Reasons Printing Via a Socket Connection Would Fail
I am writing a program that involves printing Raw Printer Command Language (PCL) files wrapped in Print Job Language (PJL) commands. I print it via a port 9100 socket connection to the printer using ...
0
votes
2
answers
77
views
How can a server communicare with multiple clients : `client_fd`, `server_fd`?
I'm reading a PDF/book on socket programming by Breej.
I understand that a server listens on a specific port (say localhost:3000).
When I connect to the server from Browser 1, it uses an ephemeral ...
0
votes
1
answer
92
views
C# .NET TcpClient.Connect and timeouts
I inherited code that calls the following:
TcpClient client;
// (removed try/catch blocks to simplify this discussion)
client = new TcpClient
{
SendTimeout = 5000,
ReceiveTimeout = 5000
};
client....
1
vote
0
answers
94
views
Capture and reinject Infiniband packets over a bridge using AF_PACKET
I am trying to capture and re-inject packets sent over ib_send_bw (infiniband RDMA) over two linux machines. I am utilizing RoCEv2 so rxe0 is my virtual NIC on both machines that would allow RDMA to ...
0
votes
0
answers
74
views
How to send client certificates and configure keep-alive + idle timeout using https.Agent in NestJS/Node.js?
I’m building a Node.js HTTP client that needs to:
Use mutual TLS (mTLS)
Enable keep-alive, so sockets are reused across requests.
Set a keep-alive idle timeout to automatically close unused sockets ...
0
votes
1
answer
63
views
non-blocking `accept` return `EAGAIN` on connection burst
I observed weird behavior when performing non-blocking accept loop. When there are multiple connection requests in the queue, only the first accept attempt succeed. All subsequent attempt fail with ...
2
votes
2
answers
101
views
UDP C# communication dummy model
this is my first time asking a question so please pardon me if I have missed out on any info. I am quite new to using UDP and other socket communications on C# so i am quite stuck on this.
I am trying ...
2
votes
0
answers
103
views
TLS 1.3 unexpected server socket close connection
i have the following code which works correctly in TLS 1.2 but fails in TLS 1.3 (in windows platform, linux this doesn't happen, in fact if you place the server end on windows, and client on linux it ...
0
votes
1
answer
92
views
WSAEWOULDBLOCK and subsequent select returns 0
I am initially getting a WSAEWOULDBLOCK from a call to connect(). Afterwards I do a select that socket included (waiting for process to complete ) and still get a zero
Here is my code:
return_code = ...
2
votes
2
answers
104
views
Meaning of "&(sockaddr_in.sin_addr)" expression
There's a nice answer to the problem of converting IP address to string representation and back.
I mean specifically this snippet:
struct sockaddr_in sa;
char str[INET_ADDRSTRLEN];
// store this IP ...
0
votes
0
answers
73
views
TCP socket server hangs randomly and rsa Decryption error raised randomly
I'm trying to make a server for a password manager I'm building, but the server seems to hang randomly and it seems to randomly throw rsa.pkcs1.DecryptionErrors randomly too. I did recently switch ...
0
votes
0
answers
92
views
Confused about python sockets
I have 2 python programs: 1st one is a tcp server that in while True cycle accepts new clients and handles each of them in a separate thread.
On the client side I have basic functionality and use it ...