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:
- To flush after sending, but I dont see a
flush functionin Socket? - Fill up the data buffer before sending out otherwise, if the data is short, then I have to
force the transmission
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?
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.NoDelayoption withSetSocketOptionmethod.