07-11-2006 05:58 PM
07-11-2006 06:08 PM
Where are the computers physically located?
Are they on the same Ethernet network or different ones?
It could be network latency if the machines are not directly connected together. It could also be network congestion if you are sending data across a busy network.
If you run both applications on the same machine, you will get the minimum latency possible as the TCP/IP stack will do the data transfer inside the machine without ever going to the physical network. The next fastest configuration is directly connecting the two PCs together with a cross-over Ethernet cable. As soon as you start adding switches, hubs, routers and external WAN links to the equation, latency will increase at every step in the chain. Latency is also dependent on the data traffic on the network as well as the NIC card architecture, the drivers in use and a lot of other factors.
Unfortunately, you may have little control over these factors so you may need to account for latency. A good way to do this is to time-stamp each message sent from one machine to the other.