Show Bid Request
timeout on connect()
Bid Request Id: 29342
|
|
|
Posted by: |
nidawi (1 ratings)
(Software buyer rating 10)
|
Posted: |
Sep 30, 2002 3:28:30 PM EDT
|
Bidding Closes: |
Oct 2, 2002 3:35:42 PM EDT
|
Viewed (by coders): |
73 times
|
Deadline: |
10/3/2002
TIME EXPIRED
|
|
|
|
Description:
I need to shorten the time a socket takes to timeout on a connect() request to about 10-20 seconds.
I am currently using connect() with a signal handler catching SIGALRM after 10 seconds to shorten the time it takes for connect to timeout. I was hoping to create some sort of easy solution to my program hanging when trying to connect to a slow domain, but of course, after the alarm, the program resumes right at that connect statement no matter what i put inside the if() statement. Is there any simple solution around the long timeout default in connect(), because I haven't found one yet?
I also looked into select() and setsockopt() but I am still at a loss on which method to use. I need this is purely C/C++ of course. :-)
alarm(10); // sets stuck to true if(stuck || connect(s, (struct sockaddr *)&addy, sizeof(addy)) < 0) { stuck = false; close(s); return -1; } return s;
~jessie~
Deliverables: 1) An working example of the code that will accomplish a reasonable timeout (10-20 seconds) for a socket's connect() request.
2) Complete ownership and distribution copyrights to all work purchased.
Platform:
Linux
Must be 100% finished and received by buyer on:
Oct 3, 2002 EDT
Deadline legal notes: All times are expressed in the time zone of the site EDT (UT - 5). If the buyer omitted a time, then the deadline is 11:59:59 PM EDT on the indicated date.
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation, you can report it to: abuse@rentacoder.com.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$20 (USD)
|
Sep 30, 2002 4:21:08 PM EDT
|
9.82
(Excellent)
|
|
|
Hi.
I will send you an example program.
Regards, Daniel |
|
|
|
|
|