NSSocketPort Mac OS X 10.0

This subclass of NSPort provides an interface to objects that can serve as endpoints for distributed objects connections over a network. NSSocketPort is implemented using the BSD Sockets API, which makes it useful for raw network communications in addition to serving as a component of the distributed objects system. A socket file descriptor that is suitable for use with the BSD Sockets API can be obtained by sending a socket message to an instance of this class.

While local communication is supported in socket ports, it is generally more efficient in terms of resource usage to use NSMachPort or NSMessagePort for local distributed objects connections.


@interface NSSocketPort : NSPort
 // Initializers
   - (id)init;
   - (id)initRemoteWithProtocolFamily:(int)family socketType:(int)type protocol:(int)protocol address:(NSData *)address;
   - (id)initRemoteWithTCPPort:(unsigned short)port host:(NSString *)hostName;
   - (id)initWithProtocolFamily:(int)family  socketType:(int)type protocol:(int)protocol address:(NSData *)address;
   - (id)initWithProtocolFamily:(int)family  socketType:(int)type protocol:(int)protocol 
   - (id)initWithTCPPort:(unsigned short)port;
 // Instance Methods
   - (NSData *)address;
   - (int)protocol;
   - (int)protocolFamily;
   - (NSSocketNativeHandle)socket;
   - (int)socketType;

    Part II: API Quick Reference
    Chapter 13. Foundation Classes