olidev
olidev

Reputation: 20624

Socket.Send has a delay?

I am building an application and sending data back to the other side,

In my application, I have:

System.Net.Sockets.Socket.Send(byte[]) function.

My customer told me that there is 530 ms delay of receiving this packet. However, I have logged every where until: System.Net.Sockets.Socket.Send(byte[])

I measured that it took about 15ms to get to send an array from Socket. My customer advised me to check:

Is one of this advice correct? I see there are also another parameter of the method Send, which is: SocketFlags <= Is there any help of using this SocketFlags?

Upvotes: 1

Views: 8312

Answers (1)

elder_george
elder_george

Reputation: 7879

There's common problem with Nagle algorithm that tries to 'glue' data sent together into single packet. It is possible that your code suffers from it as well.

Try to disable it as shown here or by setting SocketOptionName.NoDelay option with SetSocketOption method.

Upvotes: 4

Related Questions