I have several points regarding .NET socket implementation so I will state them sequentially:
- My understanding is that an instance of a Socket has a buffer of a changeable size in its internal class implementation, and is actually a queue of bytes, and also is different than the application buffer that you declare and define in your application.
- In synchronous mode using socket type:
streamand protocol type:tcp, when using the methodReceive(which is blocking the process), with a parameter application byte buffer is actually dequeuing the socket buffer in chunks that have the same size of the application byte buffer you declared and defined in your application then assigns this chunk to your application byte buffer you sent toReceivefunction. - If the above is true, then what happens when the byte buffer is larger in length than the byte elements in the socket queue?
- Also, if 2 is correct then
Sendmethod of a socket sends the the data to the end point connected host Socket buffer and not application buffer. - Finally, since the Socket method
Acceptis non-blocking, a thread is created for it in the underlying implementation, and it has a queue of its own that is dequeued whenAcceptmethod is called.
I ask all of this to check if my understanding so far is right, or if it's mostly wrong and need correcting.