#import <Foundation/NSPort.h>

@interface NSPort (hys)

/*initRemoteWithTCPPort:host:

Initializes the receiver as a TCP/IP socket of type SOCK_STREAM that can connect to a remote host on a specified port.

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

The port to connect to.
hostName

The host name to connect to. hostName may be either a host name or an IPv4-style address. 
Return Value

A TCP/IP socket port of type SOCK_STREAM that can connect to the remote host hostName on port port.
Discussion

A connection is not opened to the remote host until data is sent.
Availability
Available in Mac OS X v10.0 and later.
See Also
– initRemoteWithProtocolFamily:socketType:protocol:address:*/
- (id)initRemoteWithTCPPort:(unsigned short)port host:(NSString *)hostName;

/*initWithTCPPort:

Initializes the receiver as a local TCP/IP socket of type SOCK_STREAM, listening on a specified port number.

- (id)initWithTCPPort:(unsigned short)port
Parameters
port

The port number for the newly created socket port to listen on. If port is 0, the system will assign a port number.
Return Value

An initialized local TCP/IP socket of type SOCK_STREAM, listening on port port.
Availability
Available in Mac OS X v10.0 and later.
See Also
– init
– initWithProtocolFamily:socketType:protocol:address:*/
- (id)initWithTCPPort:(unsigned short)port;

@end
