List of all members.
Detailed Description
A class which provides functions to create and use TCP sockets.
To connect to a server, create a socket and connect it. To create a server, create a socket, bind it and listen on it.
Member Function Documentation
Accept an incoming connection.
- Returns:
- An autoreleased OFTCPSocket for the accepted connection.
- (uint16_t) bindToPort: |
|
(uint16_t) |
port |
onHost: |
|
(OFString*) |
host | |
|
|
| | |
Bind the socket on the specified port and host.
- Parameters:
-
| port | The port to bind to. If the port is 0, an unused port will be chosen, which can be obtained using the return value. |
| host | The host to bind to. Use "0.0.0.0" for IPv4 or @"::" for IPv6 to bind to all. |
- Returns:
- The port the socket was bound to
- (void) connectToHost: |
|
(OFString*) |
host |
onPort: |
|
(uint16_t) |
port | |
|
|
| | |
Connect the OFTCPSocket to the specified destination.
- Parameters:
-
| host | The host to connect to |
| port | The port on the host to connect to |
- Returns:
- Whether the socket is a listening socket
- (void) listenWithBackLog: |
|
(int) |
backlog |
|
|
Listen on the socket.
- Parameters:
-
| backlog | Maximum length for the queue of pending connections. |
Returns the remote address of the socket. Only works with accepted sockets!
- Returns:
- The remote address as a string
- (void) setKeepAlivesEnabled: |
|
(BOOL) |
enable |
|
|
Enable or disable keep alives for the connection.
The documentation for this class was generated from the following files: