Untimely NSPortTimeoutException
Untimely NSPortTimeoutException
- Subject: Untimely NSPortTimeoutException
- From: j o a r <email@hidden>
- Date: Sun, 23 Jun 2002 22:40:57 +0200
Hej,
I was just trying to see what my app would do if launched with no server running (it attempts to connect using DO over TCP). I know that the connection is not opened until first used, so I was expecting something to go wrong when I first attempted to fetch the rootProxy of the (not running) server, but I was a bit surprised with the results:
This is the interesting piece of code:
==============================================
NSLog(@"Fetching proxy of server (%f)", [serverConnection replyTimeout]);
NS_DURING
server = [[serverConnection rootProxy] retain];
NS_HANDLER
NSLog(@"localException: %@, %@", [localException name], [localException reason]);
NS_ENDHANDLER
==============================================
These are the corresponding logs:
==============================================
2002-06-23 22:31:05.460 MyApp[1736] Fetching proxy of server (10000000000.000000)
2002-06-23 22:31:05.465 MyApp[1736] localException: NSPortTimeoutException, [NSPortCoder sendBeforeTime:sendReplyPort:] timed out
==============================================
...as you can see I get the time out exception immediately. Isn't this weird? Shouldn't I get some other exception, or this exception but after the full time out? Is there some other way to detect if the remote server is up and running or not, besides this crude attempt?
j o a r
_______________________________________________
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.