|
-
Mar 4th, 2008, 03:02 PM
#3
Thread Starter
Lively Member
Re: Need Help with Socket.BeginReceive routine
 Originally Posted by Atheist
You say that your modified version of the code doesnt work, but have you verified that the original code works?
Why are you wrapping this part of the code in a try-catch block?
vb Code:
Try
' There might be more data, so store the data received so far.
lstrTemp = Encoding.ASCII.GetString(state.buffer, 0, bytesRead)
state.sb.Append(lstrTemp)
' Get the rest of the data.
client.BeginReceive(state.buffer, 0, StateObject.BufferSize, 0, New AsyncCallback(AddressOf ReceiveCallback), state)
Catch
lstrTemp = String.Empty
End Try
Hey Atheist,
Well to tell you the truth, I haven't verified that their code works, but when I do a google on the method, all the example code from others looks similar.
I've wrapped the code in a try...catch...but no exceptions are ever thrown.
Totally lost here.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|