tcp

How can I test TCP socket status in Perl?

I've got a TCP socket which reads data. When an error occurs when reading the data, I return an undef (NULL) value. Errors can be caused by badly formatted messages or broken sockets. Can someone tell me if there is a specific function which returns the status of a socket? ...

Sync Vs. Async Sockets Performance in .NET

Everything that I read about sockets in .NET says that the asynchronous pattern gives better performance (especially with the new SocketAsyncEventArgs which saves on the allocation). I think this makes sense if we're talking about a server with many client connections where its not possible to allocate one thread per connection. Then I...

Linux TCP stack packet injection

Could i inject packets to Linux TCP stack without modifying the ethernet driver? Could i do this with using a library or sth ? Thank you, ...

Other than UDP Broadcast or Multicast, what other methods can I use on a WiFI network to discover computers?

I've implemented a simple UDP ping/pong protocol to discover other computers connected to the same WiFI router. This works fine on many WiFI and Ethernet routers, but when I go out on the street to give it a try, many public WiFI networks seem to have either UDP Broadcasts/Multicast disabled, or UDP disabled completely. What other optio...

How to implement a bidirectional "mailbox service" over tcp?

The idea is to allow to peer processes to exchange messages (packets) over tcp as much asynchronously as possible. The way I'd like it to work is each process to have an outbox and an inbox. The send operation is just a push on the outbox. The receive operation is just a pop on the inbox. Underlying protocol would take care of the commu...

Spikes in Socket Performance

We are facing random spikes in high throughput transaction processing system using sockets for IPC. Below is the setup used for the run: The client opens and closes new connection for every transaction, and there are 4 exchanges between the server and the client. We have disabled the TIME_WAIT, by setting the socket linger (SO_LINGER)...

Async Socket Listener on separate thread - VB.net

I am trying to use the code from Microsoft for an Async Socket connection. It appears the listener runs in the main thread locking the GUI. I am new at both socket connections and multi-threading all at the same time. Having a hard time getting my mind wrapped around this all at once. The code used is at http://msdn.microsoft.com/en-us/...

What is the meaning of the TSV and TSER fields in an Ethereal dump?

What is the meaning of the TSV and TSER fields in an Ethereal dump? I tried googling but could not find the answer. ...

Are binary protocols dead?

It seemed like there use to be way more binary protocols because of the very slow internet speeds of the time (dialup). I've been seeing everything being replaced by HTTP and SOAP/REST/XML. Why is this? Are binary protocols really dead or are they just less popular? Why would they be dead or less popular? ...

Measuring ping latency of a server - Python

Hi folks, I have a list of server IP addresses, I need to check if each one is online and how long the latency is. I haven't found any straight forward ways of implementing this, and there seems to be a few problems in calculating latency accurately. Any ideas? ...

What is the equivalent to WinSock in the iPhone SDK?

I need to communicate with a hardware device using TCP and with Windows I would use WinSock. What is the equivalent library that I can use from the iPhone SDK? ...

tcp without Winsock

How can i work with tcp connection without Winsock or another external binary? ...

Interview Questions that can be asked on TCP/IP, UDP, Socket Programming ?

I am going for an interview day after tomorrow where i will be asked vaious questions related to TCP/IP and UDP. As of now i have prepared theoritical knowledge about it. But now I am looking up for gaining some practicle knowledge related to how it works in a network. What all is going in vaious .NET classes. I want to create a very sm...

How much buffer does NetworkStream and TcpClient have?

Hello, We are writing a TCPServer and Client program. How much space is there in the TcpClient buffer? Like, at what point will it begin to throw away data? We are trying to determine if the TcpClient can be blocking or if it should go into it's own background thread(so that the buffer can not get full).. ...

Sending json text on the wire

In C# how to send JSON in text to a tcp client from the tcp server. I have tcp server and client. ...

Java and Nagle illustration

I'm trying to illustrate the Nagle algorithm in a simple client-server program. But I can't quite figure it out, or get it to be printed to me clearly. In my example, the client just generates int's from 1 to 1024 and sends these to the server. The server just converts these int's to a hex string and sends them back to the client. Pret...

Enable RFC1323 on a per socket basis in Windows XP?

Howdy.. Anybody know if it's possible to enable RFC1323 on a per TCP socket basis in windows? I know it can be changed system wide via the registry ( http://www.psc.edu/networking/projects/tcptune/OStune/winxp/winxp_stepbystep.html ) Also, it seems like this is possible in *nix via: int on=1; setsockopt(s,IPPROTO_TCP,TCP_RFC1323,&o...

Flush kernel's TCP buffer for `MSG_MORE`-flagged packets

send()'s man page reveals the MSG_MORE flag which is asserted to act like TCP_CORK. I have a wrapper function around send(): int SocketConnection_Write(SocketConnection *this, void *buf, int len) { errno = 0; int sent = send(this->fd, buf, len, MSG_NOSIGNAL); if (errno == EPIPE || errno == ENOTCONN) { throw(exc, &S...

[C#] Async threaded tcp server

I want to create a high performance server in C# which could take about ~10k clients. Now i started writing a TcpServer with C# and for each client-connection i open a new thread. I also use one thread to accept the connections. So far so good, works fine. The server has to deserialize AMF incoming objects do some logic ( like saving th...

Select calls seems to not time out.

HI Folks, I have a threaded C++ program where up to three threads are calling select on a three separate socket descriptors waiting for data to become available. Each thread handles one socket and adds it to the readfds with a timeout of 300 seconds. After select returns if there is data available I'm calling recv to read it. Is ther...