NSSocketPort initRemoteWithTCPPort is never valid
NSSocketPort initRemoteWithTCPPort is never valid
- Subject: NSSocketPort initRemoteWithTCPPort is never valid
- From: Christopher J Kemsley <email@hidden>
- Date: Mon, 13 Jul 2009 23:40:04 -0700
This is just a quick question for anyone who may know (or, at least I
hope it's quick)
If I declare a port:
port = [ [NSSocketPort alloc] initRemoteWithTCPPort:portNumber
host:hostName ] ;
And use it with an NSConnection, it works.
If I use that same port in any other way (such as NSFileHandle) it
doesn't work. The error it gives is:
[NSConcreteFileHandle writeData:]: Bad file descriptor
(when I use initWithFileDescriptor:port.socket )
However, if I create a port like this:
port = [ [NSSocketPort alloc] initWithTCPPort:portNumber ] ;
(and add it to the port manager, run loops, etc of course)
NSFileHandle suddenly works (as a server)
Ideally, I'd like to be able to use NSFileHandle (or something very
similar) on both ends of the connection.
Any thoughts/suggestions?
Finding anything useful for what I'm trying to do online has proven to
be almost completely futile...
- Christopher
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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