#include <tcpsocket.h>

Public Member Functions | |
| TCPSocket () | |
| The default constructor. | |
| TCPSocket (socket_t _socket) | |
| The constructor for existing sockets. | |
| ~TCPSocket () | |
| The destructor. | |
| int | Accept (TCPSocket **_socket) |
| Accepts an incoming connection. Only good when listening for a connection. | |
| int | Connect (const char *_address, unsigned short _port) |
| Establishes an outbound connection to the specified address and port. | |
| int | Listen (unsigned short _port) |
| Listens for connections on the specified port. | |
| socketState | State () const |
| Fetch the state of the socket. | |
Private Member Functions | |
| int | SetAttributes (socket_t _socket) |
| Sets some important attributes on the socket. | |
Used for two-way TCP/IP communication.
| int Accept | ( | TCPSocket ** | _socket | ) |
Accepts an incoming connection. Only good when listening for a connection.
| _socket | A pointer to a NULL TCPSocket pointer variable. (e.g. TCPSocket *blah = NULL; socket->Accept ( &blah ); ) |
| int Connect | ( | const char * | _address, | |
| unsigned short | _port | |||
| ) |
Establishes an outbound connection to the specified address and port.
| _address | The remote address to connect to. Can be a hostname, as it will be resolved by gethostbyname(). | |
| _port | The remote port to connect to. |
| int Listen | ( | unsigned short | _port | ) | [virtual] |
Listens for connections on the specified port.
You need to Accept() connections after calling this.
| _port | The local port to listen on. |
Implements CoreSocket.
| int SetAttributes | ( | socket_t | _socket | ) | [private, virtual] |
Sets some important attributes on the socket.
Will set SO_LINGER and TCP_NODELAY on TCP sockets.
| _socket | The socket to modify. |
Implements CoreSocket.
| socketState State | ( | ) | const [virtual] |
Fetch the state of the socket.
Reimplemented from CoreSocket.
1.5.8