Solved

TCp/IP Nagle problem

Posted on 2003-11-07
7
316 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Put text in a picture ASP.NET C# 2 50
WPF issue with Trigger 2 95
Help me. 3 45
MsgBox 4 45
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…
This article will show, step by step, how to integrate R code into a R Sweave document
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now