Hi I am trying to use the BufferList of the SocketAsyncEventArg to send multiple buffer. A small snippet of my Send() function looks like the following.
public void Send(byte data)
e.SetBuffer(null, 0, 0);
e.BufferList = new List<ArraySegment<byte>>();
e.BufferList.Add(new ArraySegment<byte>(data, 0, data.Length));
After I get connection setup with the remote listener, and call Send(), I keep getting the 'Invalid Argument' on the OnSendComplete() callback with e.SocketError = 'Invalid Argument'.
I checked that the e.Buffer value is null which is the pre-requisite per MSDN documentation.
Does anyone know what's wrong with the code and another question is if I use BufferList, do we still process the message on the Server in the same way that we do with e.SetBuffer() ?
View Complete Post