How does TCP Send work?

BlitzMax Forums/BlitzMax Programming/How does TCP Send work?

Tibit(Posted 2005) [#1]
To people with c,c++ or java backgroung or equivalent..

TCP is stream based. So what happens when I send a TCP message? Does it only adds to a buffer and send a some predetermined interval I can't control? With UDP a message nomatter how big it is, it is sent when you run sendto( Data$ , IP , Port). But I'm unsure if TCP acts the same. And if TCP send() does not actually send one message how would I receive that message intact? Or is all this done under the hood? So that what I send and recv is like complete messages, what if I send one byte at a time? What happens if I send TCP messages on a UDP_Socket? Do I send UDP messages then? or is it a connectionless TCP? Soo strange.. Can't find any information about it. Why would I use Connect on a UDP connection? To determine if it exists only? And what does the optional Flags do?


skidracer(Posted 2005) [#2]
SetTCPNoDelay in TSocket should turn off the nagel algorithm which you could google for a good introduction to TCP stuff in general.

The most basic difference is there is no end of file with a TCPStream, it is just one big long transmission.

What is this TCP message thing you refer to? Messages are for UDP, streams are what you get with TCP, THAT is the difference.


Tibit(Posted 2005) [#3]
Great, now I know exactly what TCPDelay in max does =)

but I'm still unsure what the BlitzMax commands does, when I search for TCP and send() I don't get many relevant results. In BlitzMax the Socket.send() Socket.recv() and sendto_() and receivefrom_() doesn't have any documentation. I can guess what sendto and receivefrom does because they deal with UDP, but with TCP I don't know. I found some stuff about TCP so I'm reading it now. Still my problem (I think) has to do how BlitzMax handles it. Are the functions similar to some c++ library to which you can link me the manual? I mean if I can send TCP over a UDP connection and TCP over a UDP then why split them up? Got any links to "dangers of mixing UDP and TCP" ?


skidracer(Posted 2005) [#4]
See pub.mod/stdc.mod/stdc.c for the standard calls we are using then check out some posix docs such as:

http://linux.com.hk/PenguinWeb/manpage.jsp?section=2&name=send


Tibit(Posted 2005) [#5]
Thanks, I think I'll solve it now.


Tibit(Posted 2005) [#6]
...