A class which provides functions to create and use TCP sockets. More...
#import <OFTCPSocket.h>
Public Member Functions | |
(void) | - connectToService:onNode: |
(void) | - bindService:onNode:withFamily: |
(void) | - listenWithBackLog: |
(void) | - listen |
(OFTCPSocket *) | - accept |
(void) | - setKeepAlivesEnabled: |
(OFString *) | - remoteAddress |
Protected Attributes | |
struct sockaddr * | sockAddr |
socklen_t | sockAddrLen |
A class which provides functions to create and use TCP sockets.
- (OFTCPSocket*) accept |
Accept an incoming connection.
Bind socket on the specified node and service.
service | The service to bind | |
node | The node to bind to | |
family | The family to use (AF_INET for IPv4 or AF_INET6 for IPv6) |
Connect the OFTCPSocket to the specified destination.
service | The service on the node to connect to | |
node | The node to connect to |
- (void) listen |
Listen on the socket.
- (void) listenWithBackLog: | (int) | backlog |
Listen on the socket.
backlog | Maximum length for the queue of pending connections. |
- (OFString*) remoteAddress |
Returns the remote address of the socket. Only works with accepted sockets!
- (void) setKeepAlivesEnabled: | (BOOL) | enable |
Enable or disable keep alives for the connection.