Re: TCP connection timeout
Re: TCP connection timeout
- Subject: Re: TCP connection timeout
- From: Justin Walker <email@hidden>
- Date: Mon, 19 Jan 2004 15:02:49 -0800
On Monday, January 19, 2004, at 01:00 PM, Igor garnov wrote:
Hello,
You're right, that's the way indeed, but how can I tear down a
connection that has not been really established yet?
Should I call OTSndDisconnect ?
Jason is correct that you can use alarms to kill a connection attempt.
However, I would be leery of using alarms directly in a program that
uses Open Transport. Best to verify that this will work (perhaps
someone listening can give a yea/nay on the concept). If you are
hip-deep in carbon and other similar APIs, I don't know that this will
do what you want.
To answer your second question, there is a race between the alarm
firing and the connection completing, so your best bet is to try to
shut things down as orderly as is possible. If the connection is still
incomplete when you shut down, I assume that OT will handle that
correctly, but, again, check with someone who has a license to practice
OT and Carbon.
Regards,
Justin
On Monday, Jan 19, 2004, at 23:29 Europe/Moscow, Jason Linhart wrote:
On 1/19/04 10:53 AM Justin Walker (email@hidden) wrote:
The latter does not provide a way to modify the TCP
timeouts.
If you use the BSD network interface, instead of OT, you can time out
a
network connection attempt with an alarm. If you are using OT you can
use
an async open and then after five seconds, or however long you want to
wait, just stick the endpoint into a queue of endpoints waiting for
timeouts, continue with your program, and then discard it later when
it
finally times out and you have a moment to check the queue.
Jason
Regards,
Igor
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
--
/~\ The ASCII Justin C. Walker, Curmudgeon-at-Large
\ / Ribbon Campaign
X Help cure HTML Email
/ \
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.