Using a timeout on a thread

This is a discussion on Using a timeout on a thread within the C Programming forums, part of the General Programming Boards category; How would I implement a timeout on a thread to prevent a socket from not providing any input...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    96

    Using a timeout on a thread

    How would I implement a timeout on a thread to prevent a socket from not providing any input

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    I do not get how timeout could prevent from "not providing" something...

    Could you elaborate what are you trying to do?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    96
    I am running a server which has a thread pool that will take in a client's request on a given socket and then process this request on the socket while the server waits for more connections. But to ensure that a client doesn't connect to one of my threads and doesn't provide the thread with any input so that the just sits there useless I would like to use a timeout to close the socket after a certain period of time if there was no data processing.

  4. #4

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 02-26-2009, 11:48 PM
  2. Terminating secondary thread from another thread
    By wssoh85 in forum C++ Programming
    Replies: 13
    Last Post: 12-19-2008, 05:14 AM
  3. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 09:56 AM
  4. Critical Sections, destroying
    By Hunter2 in forum Windows Programming
    Replies: 4
    Last Post: 09-02-2003, 11:36 PM
  5. Replies: 12
    Last Post: 05-17-2003, 06:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21