Re: Getting error info when NSSocketPort initWithTCPPort fails
Re: Getting error info when NSSocketPort initWithTCPPort fails
- Subject: Re: Getting error info when NSSocketPort initWithTCPPort fails
- From: Wade Tregaskis <email@hidden>
- Date: Fri, 30 Jul 2004 08:51:20 +1000
In my testing I have been using SERVER_PORT values in the 10000 and up
range. Before I go further with this I have a few general questions:
- what are the possible causes of the nil return value? Is there any
way to get more error info?
You could step-by-instruction in the debugger, and locate the
appropriate socket() call or whatever. If you know a little assembly.
To hazard a guess, the most likely cause is that the port was used a
short time previously (a few minutes) and hasn't been released yet.
Check whether this seems to be the case; i.e. does using a unique port
always succeed?
- what is the best practice in this situation: upon failure should I
retry with a different port number until one works? Because it does
intermittently work, I could also just retry the same port number
several times...
If it's the problem I've suggested, that won't be of much help. Trying
different ports should resolve the issue in any case, so if your
program can handle that (i.e. it uses Rendezvous anyway, so a known
port is unnecessary) then by all means.
Wade Tregaskis (aim: wadetregaskis)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.