NSSocketPort, DO ignoring timeouts
NSSocketPort, DO ignoring timeouts
- Subject: NSSocketPort, DO ignoring timeouts
- From: marquis logan <email@hidden>
- Date: Mon, 18 Mar 2002 00:49:10 -0500
i'm using remote DO with tcp ports. i'm setting the timeout on the
connection but i still get a hang sometimes for about a minute, when a
remote machine is running the server but can't respond for some reason.
(i don't know the reason, i think it's a firewall issue) after ~ 1
minute i get the expected timeout exception. i had to multithread the
client to keep the ui from hanging because of these timeouts.
i'm wondering if i'm doing anything wrong.
the code is like this (snipped from an init method):
<snip>
// hold on to the port
remote = [[NSSocketPort alloc] initRemoteWithTCPPort: TCP_RL_PORT
host: host];
if(remote == nil)
{
[self autorelease];
return(nil);
}
local = [[NSSocketPort alloc] init];
NS_DURING
// reasonable timeouts?
connection = [NSConnection connectionWithReceivePort: local
sendPort: remote];
[connection setRequestTimeout: 2.0];
[connection setReplyTimeout: 2.0];
// it will hang on the rootProxy method despite the timeouts
server = [[connection rootProxy] retain];
<snip>
tia
nibs
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.