• 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 and NSFileHandle as simple network architecture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSocketPort and NSFileHandle as simple network architecture


  • Subject: NSSocketPort and NSFileHandle as simple network architecture
  • From: Charles Françoise <email@hidden>
  • Date: Wed, 13 Oct 2004 22:14:15 +0300


I am trying to make a simple network architecture based on NSSocketPort and NSFileHandle. I have my server functioning just fine (receives messages and everything). But I can't get a client to send any data.

I intialize my connection using :

socketPort = [[NSSocketPort alloc] initRemoteWithTCPPort:port host:hostname];
socketHandle = [[NSFileHandle alloc] initWithFileDescriptor:[socketPort socket]];

socketPort being an instance of NSSocketPort and socketHandle and instance of NSFileHandle. But when I try to write data to the Socket (using NSFileHandle's writeData:(NSData *)), I get a -[NSConcreteFileHandle writeData:]: Bad file descriptor error.

Please do not tell me that I can do this another way, I've tried them (SmallSockets, NSStream, BSD Sockets) and got them to work. I'm trying to get the NSSocketPort to act as client.

Thanks

Charles _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: NSSocketPort and NSFileHandle as simple network architecture
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: Folder Contents In NSOutlineView
  • Next by Date: Re: NSSocketPort and NSFileHandle as simple network architecture
  • Previous by thread: Re: Folder Contents In NSOutlineView
  • Next by thread: Re: NSSocketPort and NSFileHandle as simple network architecture
  • Index(es):
    • Date
    • Thread