I have a question regarding the System.Net.Socket.BeginSend method.
public IAsyncResult BeginSend(
IList<ArraySegment<byte>> buffers,
SocketFlags socketFlags,
AsyncCallback callback,
object state
)
If SocketFlags.None
is indicated in socketFlags
parameter, will all buffers
be sent before callback
is fired?
If the answer to the above question is NO: The
EndSend
method only returns the bytes of sent buffer. How to know whichArraySegment
s are sent? I need stupidly loop down the buffers to find the sent ones? And will it possible that halfArraySegment
is sent?If the answer to the above question is YES: Does it have any limit on the size for the
buffers
? What if I send 10MBbuffers
at once?
Generally I don't understand how the.NET processes the ArraySegment
internally. Will the ArraySegment
buffers merged into a big buffer before sending?