how to do WaitForSingleObject (win32) in c# ? (pb to receive FD_ACCEPT,FD_READ and a custom event)

  • Thread starter Thread starter herbert
  • Start date Start date
H

herbert

Hi everybody;

I've done 2 c++ class; server and client.
I would like to make the same in c#.

my waiting thread was waiting for 3 type of event:
- a socket have data to read
- a socket want to be accepted (by the listening socket)
- the event from the destructor of the class to stop the waiting thread

all of this was done with the WaitForSingleObject function, and all was OK.

The same methode in c# seems to be Socket.Select(), but i can't detect
for special event (like 'stop everything') with this method. And use
Socket.Select() with a delay of 1 second seems to be not very optimised.

What do you think of that ?
What solution ?

thanks
 
Back
Top