Looking to extend the BeginReceive
method, and the event handler for MessageQueue.ReceiveCompleted
to pass along by REFERENCE a TCPClient
object. As is, I can pass it in as an object, but it will be by VALUE, and therefore will be a copy of the TCPClient
object. No good!
So, I decided to try and write my own overloaded methods, etc. Debugging into the .NET 4.5.2 Framework code, I see that BeginReceive(TimeSpan timeout, object stateObject)
returns:
ReceiveAsync(timeout, CursorHandle.NullHandle, NativeMethods.QUEUE_ACTION_RECEIVE, null,
stateObject);
The problem is that CursorHandle
and NativeMethods
seem to be in System.Messaging.Interop
namespace, but since all those classes are declared as "internal" I can't seemingly access them. (Yes - I downloaded the .NET Framework C# code). Is there any quick way to access this stuff?