06-17-2006 09:00 PM
' Setup Callback
asyncHandle = mbSession.BeginRead(mbSession.DefaultBufferSize,
'Close
mbSession.Dispose()
mbSession = Nothing
End Sub
'Callback Sub
Private Sub OnAsyncReadComplete(ByVal result As IAsyncResult)
Dim strStuff as String = mbSession.EndReadString(IAsyncResult)
'Do stuff with strStuff
End Sub
06-19-2006 05:24 PM
06-20-2006 03:09 AM
' Setup Callback
asyncHandle = (mbSession.BeginRead(mbSession.DefaultBufferSize, New AsyncCallback(AddressOf OnAsyncReadComplete), Nothing))
End Sub
'Callback Sub
Private Sub OnAsyncReadComplete(ByVal result As IAsyncResult)
Dim strStuff as String = mbSession.EndReadString(result)
'Do stuff with strStuff
End Sub
Now then, It all works very well if I close and re-open the session each time I do a read.
However, is it supposed to behave like that?
Shouldn't I just have to open session once?
Also, this adds too much latency from the time you want the code to read and the time it actually does the read.
06-21-2006 03:30 PM