Question

I'm designing a communication protocol that will be used to communicate between two PC applications using socket connection. The most common case is when both application work on the same machine, but it will be possible to run one application on a remote machine. Application can exchange some data up to 2Mb/s. The question is: shall I use a confirmation packets to ensure that the packet sent by one application was received by the other one? I know that socket uses the TCP connection so the confirmation/retransmission is already implemented but I need some feedback from someone who used it in practice.

The technologies used: - socket server: .NET application that uses the following library: http://www.codeproject.com/KB/IP/AsyncSocketServerandClien.aspx - socket client: .NET or Delphi application

Was it helpful?

Solution

This is fine, traffic is short-circuited in the TCP/IP driver stack. There is no great difference with any other IPC mechanism, it just takes a memory-to-memory copy so operates at bus speeds. 5 gigabytes/sec typ with a microsecond or so for overhead. Plus whatever context switching needs to happen, by far the largest cost. A named pipe will operate the same. This falls off a cliff of course once you need to go through a NIC.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top