I am using the TcpListener class in C# to open up new tcp connections. I am seeing some performance issues and I want to see if it's due to running over the tcp backlog. Is there some way I can check the current size of the backlog for my process?
...
I'm using a DataInputStream to read characters/data from a socket.
I want to use .readUnsignedShort(); and have it throw an exception if there isn't 2 bytes to read. Should I subclass the DataInputStream and override the methods adding the exceptions, or is there an easier way?
...
I am trying to write a server application that listens to both IPv6 and IPv4 connections. The proper way to accomplish this seems to be listening on IPv6 address, which will also accept IPv4 connections.
The relevant piece of code is:
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints....
1- Let's say my computer ip address is 111.11.111.11, and the server that my php script is on is 222.22.222.22, so if i access and run the php script that is on the server and start a socket server, which ip do my clients need to connect to?
2- Is it possible to have a socket running on php which keeps reading, and responding to the cli...
I have a wide-character XML message that I need to send over a Win32 socket in C++.
TCHAR wszBuffer[1024];
Should I sprintf(szSendBuffer, "%S", wszBuffer) the wide character buffer to a char array before sending it?
What is the correct way to send this?
...
A windows service has an open socket that is receiving data (on a separate thread)
In response to the service OnShutdown I would like to signal worker thread to shutdown, but it's currently blocked on the Receive.
At the moment I'm timing out on the Receive to check if there is a stop request pending. Is there a better approach, rathe...
The object is essentially BYTEs of dynamic length.
What's the easiest way to implement a send/receive mechanism?
I got a tip follows but have no idea how to roll this protocol myself:
Just remember that pipes, like
sockets, don't guarantee that
everything you put in the pipe will
come out the other end in the same
number of...
I had a quick question on how i would maintain a connection of 1000 sockets. Im using threads to initiate writing and reading of the streams.
However when I pass the socket to the new thread, the thread won't exit after excecution. I wanted to know if passing the socket would keep the thread on because it was still connected.
...
Hi Alls,
I'm trying to implement a threading functionality for this answer :
http://stackoverflow.com/questions/3491727/scanning-a-class-c-network-python/3492399#3492399
So far i have something like this:
...[snip]..
m = re.search("/", str(host))
if m :
net,_,mask = host.partition('/')
mask = int(mask)
net = atod(net)
for...
Hi,
I have two computers (Client/Server) transferring video frames with UDP on 1G Ethernet.
I use socket size as ~ 1.5k.
If I make less then 10ms delay between data sending there is data loss, which is very slow for me if I want live video broadcast.
If there formula to calculate time delay needed between data sending?
Can I test if HW...
Hi, I have a SSLSocket pool and I need to check if the socket connection is sane before borrowing the object.
The isConnected, isInputShutdown and isOutputShutdown are useless because they don't check if both sides are connected and if I try to write or read from the socket I might get a SocketException.
Here is my code for testing a c...
Hi Experts,
I'm not a software person, but I could really use some advice.
I'm writing a C program (cut/paste below) to establish a TCP socket connection from my Mac Pro to a Windows XP-based test-instrument sitting next to it over LAN (Ethernet). The program compiles without any warnings or errors. But executing the code using GNU Deb...
I'm trying to connect to some host, using invalid port, and i want to get timeout after X seconds. How to do that ?
My code:
$sock = new IO::Socket::INET(
PeerAddr => $_[0],
PeerPort => $_[1],
Proto => 'tcp',
Timeout => 2
);
...
Hi All,
I've been searching the net for answers but I can't seem to find a complete answer.
Scenario: I have a client API and a server. An application uses the client API to talk to the server. Both TCP and UDP are used to communicate between the client API and the server. All of this has been written using ASIO.
The client API conn...
I'm trying to read items from a socket and I notice that if there is nothing on the stream of the socket it will stay at the read and back up my application. I wanted to know if there was a way to set a read timeout or terminate the connection after a certain amount of time of nothing in the socket.
...
I want to debug TCP/IP interactions for a program I'm enhancing. I don't have root access (so no tcpdump etc), but the app runs under my own id. I could use e.g. strace to intercept the system calls, but are there alternatives worth recommending over that? If so, why - what do they offer? Command line prefered (no X server installed ...
A TcpClient instance, created with the Accept method, is used for manage a client connection. The problem arise when I need to terminate the server thread, since it is blocked on a receive call.
So I setup a the TcpClient ReceiveTimeout in order to loop every n milliseconds to test the exit condition. The result is that the Receive oper...
Hi.
I am trying to make a simple HTTP server that would be able to parse client requests and send responses back.
Now I have a problem. I have to read and handle one line at a time in the request, and I don't know if I should:
read one byte at a time, or
read chunks of N bytes at a time, put them in a buffer, and then handle the byte...
Are there differences in how Windows and Linux implements sockets? Is this a os concert or rather one entirely dependant on programming platform?
...
Hi,
I use blocking C sockets on Windows.
I use them to send updates of a data from the server to the client and vice versa. I send updates at a high frequency (every 100ms). Does the send() function will wait for the recipient recv() to receive the data before ending ?
I assume not if I understand well the man page:
"Successful com...