Hi,
I am using sync and async operations on the same socket.
generally I want the socket to wait on BeginReceive and to not block the
object thread.
but in some cases I want to stop the BeginReceive in the middle - Don't
accept any data from it , and using regular Receive (I don't want the data
will come to the BeginReceive byte buffer , instead of other buffer)
then when I comlete some operaion , to return and call to the BeginReceive
again.
How can I do it ?
I try to hold the AsynCallBack , and the IAsyncResult and call EndInvoke but
it make exceptions:
Fail: The async result object is null or of an unexpected type. at
System.Runtime. Remoting.Proxie s.RealProxy.End InvokeHelper(Me ssage reqMsg,
Boolean bProxyCase)
at System.Runtime. Remoting.Proxie s.RemotingProxy .Invoke(Object NotUsed,
MessageData& msgData)
at System.AsyncCal lback.EndInvoke (IAsyncResult result)
Thanks
I am using sync and async operations on the same socket.
generally I want the socket to wait on BeginReceive and to not block the
object thread.
but in some cases I want to stop the BeginReceive in the middle - Don't
accept any data from it , and using regular Receive (I don't want the data
will come to the BeginReceive byte buffer , instead of other buffer)
then when I comlete some operaion , to return and call to the BeginReceive
again.
How can I do it ?
I try to hold the AsynCallBack , and the IAsyncResult and call EndInvoke but
it make exceptions:
Fail: The async result object is null or of an unexpected type. at
System.Runtime. Remoting.Proxie s.RealProxy.End InvokeHelper(Me ssage reqMsg,
Boolean bProxyCase)
at System.Runtime. Remoting.Proxie s.RemotingProxy .Invoke(Object NotUsed,
MessageData& msgData)
at System.AsyncCal lback.EndInvoke (IAsyncResult result)
Thanks
Comment