1. I'm using WinSock, but this is a generic question. Let's say the connection between the server and the client has been established. When I send a packet to the server from client, the data won't be transmited until the server calls its receive function; so, where does that sent data temporaroly stay? Does it keep pinging the server?.

2. And I think if the client's send function is repeated before the server calls its receive function the data is buffered, again where? and is this correct?

Posted on 2003-02-18 13:07:38 by gregd
Thomas could probably explain this better than me, but I'm going to take a shot in the dark.

You are getting the OSI levels confused. Your machine will receive the TCP/IP packets just fine and will put store them in a 'buffer'. Once you call the function receive( dealing with nonblocking sockets ) your function will get what data is available ... so what is in your buffer.

1) The TCP/IP packet(s) will be sent from the client to the server whenever you send them ... granted that the client does not buffer the output. The server receives the TCP/IP packet(s) and does all the work( such as error checking, validating, putting everything together, etc ... you gotta love TCP/IP ) the data is stored on the server using buffers( we have walked up the OSI model, from the physical layer to the application layer )

Now exactly how the server stores the data received, I don't know that.

There are also seven layers to the OSI model .. I found this page ... http://www.leedev.net/~gorshing/osi_model.html

Hope I was of some help,
Posted on 2003-02-18 14:17:36 by gorshing
yeah..you are right. it depends on the tcp/ip implementation on that platform. and as a programmer you should not worry about it.

if you really want to dig into network stacks, then you can take a look at the lwip stack developed for embeded systems.

note that the above stack cannot be termed as complete tcp/ip implementaion. its just an emulation of tcp stack. nonetheless, the code is very small and you can go through it thoroughly in one day.

and if are _really_ serious , may i suggest you going through linux kernel source :D
there are some books on linux kernel that covers the llinux network stack too.
Posted on 2003-03-04 07:23:32 by himanshu