Find the answer to your Linux question:
Results 1 to 4 of 4
Hey there, I have a problem with select() that I would really appreciate if you guys help me out with! here is some of my code: Code: CODE DELETED the ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    35

    problem with select()!!!

    Hey there,

    I have a problem with select() that I would really appreciate if you guys help me out with!
    here is some of my code:

    Code:
    CODE DELETED
    the problem is, select() times out ALWAYS after the specified time, even when the client is receiving data from the server, I tired everything, spent the last few hours just messing around with the code and reading about select() but to no avail

    anyone has any ideas whats the problem?

    thank u in advance

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    You have to cancel the timer if select() has triggered but not timed out, and then reset it after the recv() call.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    35
    Quote Originally Posted by Rubberman View Post
    You have to cancel the timer if select() has triggered but not timed out, and then reset it after the recv() call.
    can you elaborate on that, what do u mean by cancel my timer, do u mean I need to reinitialize my timeval?

    EDIT: OFCOURSE, its so simple, how i didnt think of that, so many hours wasted trying to search for what i did wrong, arghhhhhhh, oh well atleast now i fully understand select() since i read its manual like 100000 times, thanks alot dude, really thanks

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Yeah. It's the 100001st time whacking oneself on the head that stuff sticks...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...