   nonblocking setup?
  I have a nice windows socket program that sortaworks at the moment.  One main problem I''ve runinto involves the fact that I''m using threadingto take care of the fact that my sockets are inblocking mode.  So, if a thread happens to failit has no way of telling the program that it isno longer working.  So the program has a tendencyto deadlock.I was wonding 1) how to set a socket to non-blockingmode.  2) how to have a thread signal that it hasdied, so that other threads will know that there isa problem 
  One way is for each thread to have a "done" Event which they set when they''re going away. The program main thread will typically sit waiting in WaitForMultipleObjects on all the threads'' events (or a windows message). When an even fails, it sets a status flag somewhere and sets the event, then it exits. The main thread finds that the event un-blocks it, and can read out the status.Typically, you''d have one struct/record/object per thread, and pass a pointer to that as the thread entry func argument. This struct could be in some list managed by the main thread, and contain the status area where the thread writes status.Just as one, simple example. There are lots of other ways, depending on what you actually want. 