Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How can I tell if a port is already being used?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I tell if a port is already being used?



Greetings,

   Okay, gotta Poka-yoke my code.

   So I reworked my code like so....

- (void)newConnection:(NSNotification *)notification
{
NSDictionary *userInfo = [notification userInfo];
NSFileHandle *remoteFileHandle = [userInfo objectForKey:NSFileHandleNotificationFileHandleItem];
NSNumber *errorNo = [userInfo objectForKey:@"NSFileHandleError"];
if( errorNo )
{
NSLog(@"NSFileHandle Error: %@", errorNo);
return;
}
........


When I attempt to connect to a used port I log...

2006-12-27 11:41:24.749 xxxxxx[4814] NSFileHandle Error: 38

The docs say about NSFileHandleError....

"An NSNumber object containing an integer representing the UNIX-type error which occurred."

Where can I find a meaningful representation of the UNIX-type errors.

Thanks,

- Brian





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.