Hi all,
A simple question really, but one where I cannot find any anwsers too.
When I execute an Asynchronous Socket operation, such as :
socket.BeginSend
(
new byte[]{6}, // byte[] | buffer
0, // int | data to send buffer offset
1, // int | data to send length
SocketFlags.None, // enum | dunno :)
new AsyncCallback(OnSend), // AsyncCallback | callback method
STATEOBJECT // object | ..state object..
);
It works, and when complete it invokes the AsyncCallback parameter, passing with it an IAsyncResult.
void OnSend(IAsyncResult ar)
{
object STATEOBJECT = ar.AsyncState as object;
/*
Process the socket operation
*/
}
SO..
When the socket operation is being executed 'asynchronously' I know from various sources that the buffer is pinned in memory.
However I do not know where the 'state object' is stored?
why? because I am wondering what the effect of large 'state object's will have?
Taa!