66,410 questions
0
votes
1
answer
50
views
how to create a new client connection FROM the Server-side using python socket programming?
I'm using python socket programming to build a mock VPN service. the way I want it to work is that the server is launched, then the user client (Host-U) is launched. The Server should send a message ...
0
votes
1
answer
27
views
How do I use Socket.io with Fastay? I can’t access the server instance
I’m trying to run Fastay.js as a separate backend, and I really need Socket.io because my app depends on real-time features. But I’m stuck: Fastay doesn’t give me access to the underlying HTTP server, ...
3
votes
2
answers
83
views
How do these 2 string buffers interact? Why does the internal logger buffer append to the buffer i dynamically allocate in main
So, for context, I have started writing a small HTTP-Server for learning purposes.
Currently, I have 2 modules: server and logger. The server module uses the logger I wrote internally for logging ...
0
votes
0
answers
24
views
Chat message duplicated only on first send – Flutter + Node.js + Socket.io
I'm building a chat feature using Flutter frontend, Node.js backend, MongoDB, and Socket.IO.
Issue:
When sending the first message in a conversation, the message appears twice (duplicated).
If I exit ...
Best practices
1
vote
3
replies
118
views
What is the best option for handling multiple clients for a server in C?
I know that the current options are: creating a thread, a fork or a non-blocking socket?
What are the main advantages and disadvantages of all options?
What would be the recommendation for a small ...
Best practices
1
vote
3
replies
72
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 ...
2
votes
1
answer
122
views
Sending raw packets back to host's networking stack
I'm writing a TCP/IP stack for embedded systems, but I wanted to test it on my host system.
Originally I tried with tap0 + a bridge. But I quickly realized it would make the most sense to bind to the ...
Best practices
0
votes
5
replies
71
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 ...
0
votes
0
answers
56
views
Java socket connection to GCP Cloud PostgreSQL - Service account authentication
We are trying to connect to the GCP PostgreSQL DB from our Java application using socket connections and service account for authentication.
String dbUser = "[email protected]"...
1
vote
1
answer
107
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 ...
2
votes
0
answers
37
views
Micropython socket.getaddrinfo fails when using DNS on local network
tl;dr: Using a DNS server on a local network causes socket.getaddrinfo() to experience an error:
OS Error: [Error 103] ECONNABORTED
Using an internet DNS server works.
Details: I have a very simple ...
0
votes
1
answer
100
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 ...
0
votes
1
answer
49
views
Python DSL Delta is not plat-form independent [closed]
Python DSL Delta is not plat-form independent
Server Socket Code for getting input url from user's client curl or browser
Please make note curl will reply to empty server as disguise, but browser ...
2
votes
1
answer
59
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 ...
1
vote
0
answers
28
views
Reusing socket which failed to connect with timeout seems bad - is it documented somewhere? [duplicate]
Briefly: is the requirement to re-create TCP socket after it failed (e.g. on timeout) documented in some official manual, guide etc?
In details:
Some code I stuck upon is faulty in the following way:
...
0
votes
0
answers
56
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 ...
1
vote
1
answer
47
views
Incorrect Transcription from AWS Transcribe in cases which include the digit "7" [closed]
I’m using AWS Transcribe Service to convert user audio input into text. It works perfectly in almost all cases, except when the spoken input contains numbers, particularly those that include the digit ...
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 ...
0
votes
0
answers
91
views
BSD UDP: When do socket descriptors become invalid due to OS intervention?
I'm working with Linux UDP sockets and need to identify scenarios where socket descriptors become invalid due to OS intervention rather than application errors, i.e. where the application can get ...
3
votes
1
answer
196
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).
...
0
votes
0
answers
60
views
Node.js WebRTC server on Azure App Service fails STUN discovery (srflx candidates) despite open NSG ports
I am building a Node.js WebRTC media bridge (a Back-to-Back User Agent or B2BUA) that connects a browser-based client to the WhatsApp Calling API. The backend is hosted on an Azure App Service for ...
3
votes
1
answer
129
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>
...
3
votes
1
answer
139
views
Why does recvfrom() constantly output -1 in my code?
I'm practicing in networking programming. Currently I'm trying to make a program that crafts a single ARP packet and receives the response. Further, I want to expand it to handle the whole subnet.
But,...
4
votes
1
answer
150
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
52
views
Can't a custom netlink protocol be bound by the application process via the bind method?
I'm attempting to receive kernel messages in a userspace program via a custom Netlink protocol. For example, obtain the plug-in and pull-out status of the DP interface and the information of the ...
1
vote
0
answers
94
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 ...
2
votes
0
answers
203
views
How do I connect to my own C server from another machine on same network? [closed]
I can connect a Unix server and client socket just fine, but only if they are on the same machine.
My code does not work even if they are running on separate machines connected to the same router.
To ...
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 ...
1
vote
0
answers
120
views
Using the MELSEC Communication Protocol, Correct way to Read Multiple Data Register for Mitsubishi FX5UC-32MT/DSS-TS PLC
I'm working with a Mitsubishi FX5UC-32MT/DSS-TS PLC and trying to read data from multiple D registers using the MC protocol, specifically the 0406 command (QnA-compatible 3E frame for multiple-block ...
3
votes
3
answers
159
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 ...
3
votes
2
answers
125
views
Does UDP receive messages in a queue-like format?
I have two programs set up to mimic two machines that will be communicating using UDP (I know TCP sounds better in this situation, but the manufacturer for one of the machines made it such that ...
0
votes
0
answers
68
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
1
answer
113
views
How can I handle multiple TCP clients concurrently in Node.js without blocking others?
I'm trying to build a lightweight TCP server in Node.js that can handle multiple clients concurrently without blocking any of them — and all of this in a single-threaded manner, staying true to Node....
0
votes
2
answers
85
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
72
views
In Next.js, not using sockets but getting GET 404
There was another post like this, but the only answer it had was to just restart, which didn't work for me.
I added sockets to my project for the first time, it wasn't working so i reverted to a ...
0
votes
1
answer
100
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....
0
votes
0
answers
47
views
socket io java android app and socket io javascript server reliable connection possible?
I need to make a reliable socket io solution for my android apps for chatting app or similar. When I was tinkering with the system I noticed the socketio java client is getting disconnected every few ...
1
vote
0
answers
98
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
1
answer
65
views
System (PID 4) listens on my port after I close the listening socket
On Windows Server 2022 I'm running a custom HTTPS server (part of a larger app). The service binds, listens and then accepts on port 81 for a while and netstat -abn shows:
TCP 0.0.0.0:81 ...
0
votes
0
answers
83
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 ...
2
votes
0
answers
52
views
sockets: cannot connect with more than a few sockets to a given client [closed]
Consider the following sample code:
#include <iostream>
#include <string>
#include <cstring>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#...
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 ...
0
votes
0
answers
23
views
AF_UNIX Socket Domain
In network socket send() call will write data to the sender buffer and recv() call will read from the receive buffer.
But in the AF_UNIX domain Is there a sender and receive buffer? or maybe the data ...
2
votes
2
answers
103
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 ...
0
votes
0
answers
91
views
recv() or select() doesn't return immediately after shutdown() and abortFlag in multithreaded socket listener
I'm working on a Windows TCP socket-based listener in C++ where the Listener() function runs in a separate thread. It waits for image frames from a detector device. I have implemented an Abort() ...
2
votes
0
answers
104
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 ...
-1
votes
0
answers
55
views
Problem With Receiving Data Using recv() call [duplicate]
client.cpp
#include <sys/socket.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <iostream>
#include <string.h>
#include <fcntl.h&...
0
votes
1
answer
93
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 = ...
0
votes
0
answers
66
views
How does the process of reading data from the recv buffer work?
I know that the send() and recv() will write and read data from sender buffer & receiver buffer which is limited in size.
That's way if we want to send big data like we want to send 200mb data ...
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 ...