• 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
Re: Network communication with NSFileHandle & NSSocketPort
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Network communication with NSFileHandle & NSSocketPort


  • Subject: Re: Network communication with NSFileHandle & NSSocketPort
  • From: Andrew Farmer <email@hidden>
  • Date: Wed, 19 Mar 2008 03:41:52 -0700

On 19 Mar 08, at 02:58, Valentin Dan wrote:
unsigned short serverPort = 9000;

NSString * serverAddress = @“192.1.2.1”;

NSSocketPort * socketPort = [[NSSocketPort alloc] initRemoteWithTCPPort:serverPort host:serverAddress];

NSSocketPort is part of the Distributed Objects API - despite the name, it's not a general-purpose socket class. Unless this is specifically what you're trying to do, you'll need to initialize a socket FD yourself using BSD calls, then create a NSFileHandle from that using initWithFileDescriptor:.


There are a couple of alternate approaches. There's CFSocket if you don't mind working with CoreFoundation. If you want a set of Cocoa classes, there's NetSocket, among others._______________________________________________

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:
    • Downloading via FTP and loading images in a NSTableView
      • From: "Valentin Dan" <email@hidden>
References: 
 >Network communication with NSFileHandle & NSSocketPort (From: "Valentin Dan" <email@hidden>)

  • Prev by Date: Re [Moderator] No iPhone SDK discussion here please
  • Next by Date: Correct use of NSViewController
  • Previous by thread: Network communication with NSFileHandle & NSSocketPort
  • Next by thread: Downloading via FTP and loading images in a NSTableView
  • Index(es):
    • Date
    • Thread