System.Net.Sockets

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

I am using the System.Net.Sockets class and I've used the DataArrival
event in VB6 to capture data returned to me from a socket connection.
How do I do the equivalent of this in C#?


Thanks,

Mike
 
Assuming you've arready created the socket and connected, you now want
to exchange data. If your processing the Socket asynchronously you
would call BeginReceive and specify the callback method as part of the
function. When data arrives, the callback method is invoked. If you
know there is more data coming, you would save the current data and
then call BeginReceive again.

If you are processing the socket synchronously, the you would just call
Receive and the the function would block until there was data returned.
Hope this helps.

Rob Vretenar [imason inc.]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top