Note that there are some explanatory texts on larger screens.

plurals
  1. POHigh Frequency Data Listener TCP Overload on WIndows 7
    primarykey
    data
    text
    <p>I have coded a c# based listener to retrieve data from a stock market server. The problem is, after monitoring through WireShark, TCP window gets full, meaning that the receiving host (me) has trouble processing incoming data fast enough. <br><br> I Know my data provider has disabled TCP acknowledgement from his side, so basically he just pushes TCP Packets and looks if they are "still there" : If he detects that they were not processed after a certain amount of time, connection is simply shut down.</p> <p>I really don't know what to do, Ive disabled Windows 7's Auto Scale Tuning and also Heuristics, but that did not have any effect. I also noticed that there is no way to set TPC Windows Size (RWIN) on Windows 7.</p> <p>I Know this is not a programming related question <em>per se</em> but it is somehow, because this is critical from the code point of view.</p> <p><strong>EDIT</strong><br> A responder stated : "your application is not pulling data out of it fast enough" This is fairly interesting, but I have no real idea on how to optimize this :</p> <pre><code> private class IoContext { // The socket used for the operation: public Socket _ipcSocket; // The buffer used for the operation: public VfxMsgBlock _ipcBuffer; public IoContext(Socket socket, VfxMsgBlock buffer) { _ipcSocket = socket; _ipcBuffer = buffer; } } private void InitiateRecv(IoContext rxContext) { rxContext._ipcSocket.BeginReceive(rxContext._ipcBuffer.Buffer, rxContext._ipcBuffer.WrIndex, rxContext._ipcBuffer.Remaining(), 0, CompleteRecv, rxContext); } private void CompleteRecv(IAsyncResult ar) { IoContext rxContext = ar.AsyncState as IoContext; if (rxContext != null) { int rxBytes = rxContext._ipcSocket.EndReceive(ar); if (rxBytes &gt; 0) { //Adjust the write index in the message block: rxContext._ipcBuffer.WrIndex = rxContext._ipcBuffer.WrIndex + rxBytes; //(...) Do Stuf here with data rxContext._ipcBuffer.Crunch(); //Initiate another asynchronous read: InitiateRecv(rxContext); } } } </code></pre> <p><strong>EDIT 2</strong> <br> In response to Len Holgate : </p> <p>I changed/checked the Recv Buffer size directly via c# property (got some troubles using GetSocketOption/SetSocketOption)</p> <p>I can notice a slight performance change when I vary the Socket Buffer size, ie connection drops after 10mn with a big bufer (1000000) rather than 3mn (using 10240 or less (even 0, I don't know why... weird))</p> <p>Here is the first WireShark log I am getting : </p> <pre><code>[SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1380 SACK_PERM=1 WS=128 </code></pre> <p>It doesn't change whatever the Socket's receive buffer size</p> <p>About Windows 7 &amp; TCP Windows size, I meant than the re-write of TCP Management in Windows resulted in it being scaled automatically, and no registry parameter is available to set it "by hand". <br> However, you are right : On a per-socket basis, it is adjustable using the receive buffer size.<br> Source <a href="http://www.227volts.com/?p=802" rel="nofollow">here</a> among others</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload