disabling the send delay on TCP

Started by
26 comments, last by GameDev.net 19 years, 3 months ago
im sorry about the name because i forgot wats its caled. In TCP connections and maybe UDP i dont no but they have that algorithm that waits for a certain amount of data to be in the buffer before it sends it out. Ive heard that u can use TCP_NODELAY or something like that in C++ to disable it but i dont no how to do that in vb!! any help would be great thx Jake
Advertisement
I don't know the specific answer to your question, but the thing you're talking about is the Nagle algorithm. Google that up. And no, UDP generally does not employ anything similar. By the way, you really should only turn this off if you have an absolutely amazing reason to do so. Usually when you want this what you're really looking for is UDP.
Yes, you want to set the TCP_NODELAY option.

The Forum FAQ talks explicitly about this -- although it doesn't do it in VB. I'm assuming you know enough VB to translate typical C/C++ API information to the equivalent VB. If not, then your question is better put in a VB forum, rather than a networking forum.
enum Bool { True, False, FileNotFound };
We don't use this in Eternal Lands, and it works pretty well.
You see, there are two issues here:
1. If you disable that then there will be more bandwidth used (more packets means more headers) so in some cases, especially dial up users, they will notice a slow down rather than a speed increase.
2. A server is usually busy sending data all the time, especially in crowded areas, so it won't really wait that much to send the data.
But the delay is very small anyway, maybe a few MS, so it's not really worth it.
thx for all the replies. im not gonna try and disable it now. But the reason y i wanted to do this was because that vb puts packets together. If i send data at a normaly speed of every 10ms, sometimes i can get like 5 dif packets stuck together. My temp solution was to slow it down to 100ms, which is extremely slow when there is 50 users all connected to a single server :S.
What's wrong with 5 packets stuck together? that's how it should be.
really??

ok lets say the server sends a message like someone wispers the user, and then the user list, and finally w/e else was typed in the chat. instead of it being like
"wisper:User1: hey"
"user:user1:user2:user3"
"user2: watsup?"
"user3: n2m u?"

it would be
"wisper:User1: heyuser:user1:user2:user3user2: watsup?user3: n2m u?"

so then when i have to pick out certain commands, i cant casue there all stuck together!!
Yes, you will need some flow control protocol.
In Eternal Lands it's like this:
octet 1: protocol (what kind of command follows)
octet 2 and 3 (a short) is the length of the data
then there is the rest of the message.
So when you get the data you check it's length and split it accordingly.
how do i do that cause i have no clue how to write that out
It's not that hard, this will be one of the EASY things to do, in a multiplayer game.
If you know C, and feel like looking at some of my code, let me know.

This topic is closed to new replies.

Advertisement