- Declared In:
- NSFileHandle+Extensions.h
Endpoints for socket handlesShutdown
- - localPort
- - localAddress
- - remotePort
- - remoteAddress
- - remoteHost
Non-blocking reads on sockets
- - shutdown
- - shutdownInput
- - shutdownOutput
- - availableDataNonBlocking
- - readDataToEndOfFileNonBlocking
- - readDataOfLengthNonBlocking:
- (NSData *)availableDataNonBlocking
Calls readDataOfLengthNonBlocking: with a length of UINT_MAX
, effectively reading as much data as is available.
- (NSString *)localAddress
Returns the address of the local endpoint of the socket in the "typical" dotted numerical notation.
- (unsigned short)localPort
Returns the port of the local endpoint of the socket.
- (NSData *)readDataOfLengthNonBlocking:(unsigned int)length
Tries to read length bytes of data. If less data is available it does not block to wait for more but returns whatever is available. If no data is available this method returns nil
and not an empty instance of NSData.
- (NSData *)readDataToEndOfFileNonBlocking
Calls readDataOfLengthNonBlocking: with a length of UINT_MAX
, effectively reading as far towards the end of the file as possible.
- (NSString *)remoteAddress
Returns the address of the remote endpoint of the socket in the "typical" dotted numerical notation.
- (NSHost *)remoteHost
Returns the host for the remote endpoint of the socket.
- (unsigned short)remotePort
Returns the port of the remote endpoint of the socket.
- (void)shutdown
Causes the full-duplex connection on the socket to be shut down.
- (void)shutdownInput
Causes part of the full-duplex connection on the socket to be shut down; further receives will be disallowed.
- (void)shutdownOutput
Causes part of the full-duplex connection on the socket to be shut down; further sends will be disallowed.