PATH  Documentation > Mac OS X > Foundation Reference: Objective-C



Table of Contents

NSSocketPort


Inherits from:
NSObject
Conforms to:
NSCoding
(NSPort)
NSCopying (NSPort)
NSObject (NSObject)
Declared in:
Foundation/NSPort.h




Class Description


NSSocketPort is a subclass of NSPort which can be used as an endpoint for Distributed Object connections (or raw messaging). A companion class, NSMessagePort allows for local (on the same machine) communication only. NSSocketPort, allows for both local and remote communication, but may be more expensive than NSMessagePort for the local case; there is also no name registry service for NSSocketPorts -- clients and servers must agree on the TCP port numbers to use beforehand.

A subclass of NSPort represents a particular flavor of data transport from one process to another. Note that instances of port subclasses cannot be mixed on a particular communication channel. For example, a client cannot connect to a server using NSMessagePort if the server only supports connections made with NSSocketPort. Also, you cannot transfer instances of NSMessagePort in a message to another process over a channel which is using NSSocketPorts as its endpoints; you can only pass NSSocketPorts on such a channel. These restrictions apply to any subclasses of NSPort, not just NSMessagePort and NSSocketPort. However, you are free to create other connections to a server using other subclasses of NSPort (assuming the server supports multiple transports) and send instances of that other subclass on that channel.




Method Types


Creating instances
- init
- initWithTCPPort:
- initWithProtocolFamily:socketType:protocol:address:
- initWithProtocolFamily:socketType:protocol:socket:
- initRemoteWithTCPPort:host:
- initRemoteWithProtocolFamily:socketType:protocol: address:
Getting information
- address
- protocol
- protocolFamily
- socket
- socketType


Instance Methods



address

- (NSData *)address

Description forthcoming.

init

- (id)init

Description forthcoming.

initWithTCPPort:

- (id)initWithTCPPort:(unsigned short)port

Description forthcoming.

initWithProtocolFamily:socketType:protocol:address:

- (id)initWithProtocolFamily:(int)family socketType:(int)type protocol:(int)protocol address:(NSData *)address

Description forthcoming.

initWithProtocolFamily:socketType:protocol:socket:

- (id)initWithProtocolFamily:(int)family socketType:(int)type protocol:(int)protocol socket:(NSSocketNativeHandle)sock

Description forthcoming.

initRemoteWithTCPPort:host:

- (id)initRemoteWithTCPPort:(unsigned short)port host:(NSString *)hostName

Description forthcoming.

initRemoteWithProtocolFamily:socketType:protocol: address:

- (id)initRemoteWithProtocolFamily:(int)family socketType:(int)type protocol:(int)protocol address:(NSData *)address

Description forthcoming.

protocol

- (int)protocol

Description forthcoming.

protocolFamily

- (int)protocolFamily

Description forthcoming.

socket

- (NSSocketNativeHandle)socket

Description forthcoming.

socketType

- (int)socketType

Description forthcoming.


Table of Contents