• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSSocketPort initRemoteWithTCPPort is never valid
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSSocketPort initRemoteWithTCPPort is never valid
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: [iPhone] Network connection between 2 iPhones-Can GKVoiceChat be my solution?
  • Next by Date: Re: spaghetti code with core data and multiple views
  • Previous by thread: Re: [iPhone] Network connection between 2 iPhones-Can GKVoiceChat be my solution?
  • Next by thread: Re: NSSocketPort initRemoteWithTCPPort is never valid
  • Index(es):
    • Date
    • Thread