Solved

TCp/IP Nagle problem

Posted on 2003-11-07
7
340 Views
Last Modified: 2013-11-13
I have an application that usues Tcp/Ip to communicate...the host sends very frequent time depenedant staus messages to the ckient.. like every 20 milliseconds...I cant slow them down... however i hit the nagle problem of the small packets being combined.. that screws up the timing aspect! How can i within Vb abdnd the winsock ocx, turn off nagling!!!!!



0
Comment
Question by:Hotbread
7 Comments
 
LVL 5

Expert Comment

by:fantasy1001
ID: 9700071
As far as I know, you need to set SetSockOption API to WSQ_SOCK_OPTION.WSQ_TCP_NODELAY.
This must be done per every connection.
0
 
LVL 1

Expert Comment

by:DeuceEE
ID: 9700798
I had such problem and I had a workaround (not sure of any communcation settings, this is just a simple code).

At the end of every packet you send, send a unique character or two of yours -- some programs actually append Chr$(2) & Chr$(4) at the end.
On the other side, receive the packet and split it using the flag you created.

Assume you want to send "Hello" followed by "World!", and they were sent instantly that it became like this: "HelloWorld!". Using the flag, they will become "Hello24World!24" (I used the numbers 2 and 4 to represent Chr$(2) and Chr$(4)). At every occurance of the 24 flag, that is a packet.


My suggestion is very simple that I just noticed it's a 500-point question, I'm sure that wasn't what you were looking for, but I'm putting it for others who might find it helpful for related issues.
0
 

Author Comment

by:Hotbread
ID: 9701073
Thanks guys;... fraid I tried that DeuceEE BUT I need a packet every 20th of a sec to syncronise... so its not just the actual data BUT the time they arrive... fantasy... how can I do that with vanilla VB and using the winsock ocx control is it possible?
0
 
LVL 5

Expert Comment

by:fantasy1001
ID: 9711699
I am not sure of it. I used to have this problem long time ago with winsock also. One of our programming expert suggests that we use the api SetSockOption and set it to WSQ_SOCK_OPTION.WSQ_TCP_NODELAY. I donn't have pretty much info on it anyway.

0
 

Accepted Solution

by:
amp072397 earned 0 total points
ID: 10528617
PAQed - no points refunded (of 500)

amp
Community Support Moderator amp~at~experts-exchange.com
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question