Erm, you use select(), and you post some kind of attempt at using select() so we can figure out where you went wrong.
Saying which OS and compiler you're using would be a good idea as well.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Erm, you use select(), and you post some kind of attempt at using select() so we can figure out where you went wrong.
Wouldn't select() itself block !? If it does it anyway can't be used for this problem..
from what I know a blocking socketwill be blocking. If you're not creating the socket then try making it non-blocking while you're using it and then make it blocking once you're done with your work.. not so nice to do though..
Use fcntl to make it non/blocking..
thekashyap
Practically a Posting Shark
811 posts since Feb 2007
Reputation Points: 254
Solved Threads: 75
You can specify a timeout with select().
I wasn't going to bother answering the post without code tags.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953