Very Simple Cross-Platform Library
|
#include <TCPClientSocket.h>
Public Member Functions | |
TCPClientSocket (struct in_addr address, unsigned short port, Waiter *waiter=0, size_t readingCapacity=DEFAULT_CAPACITY, size_t writingCapacity=DEFAULT_CAPACITY) | |
TCPClientSocket (const char *address, unsigned short port, Waiter *waiter=0, size_t readingCapacity=DEFAULT_CAPACITY, size_t writingCapacity=DEFAULT_CAPACITY) | |
TCPConnector & | getConnector () |
Public Member Functions inherited from hu::varadiistvan::scpl::io::BufferedStream | |
virtual | ~BufferedStream () |
ReadingBuffer & | getReadingBuffer () |
WritingBuffer & | getWritingBuffer () |
Public Member Functions inherited from hu::varadiistvan::scpl::io::Failable | |
Failable () | |
bool | failed () const |
errorCode_t | getErrorCode () const |
void | repair () |
Additional Inherited Members | |
Static Public Attributes inherited from hu::varadiistvan::scpl::io::BufferedStream | |
static const size_t | DEFAULT_CAPACITY = 4096 |
Protected Member Functions inherited from hu::varadiistvan::scpl::io::Failable | |
void | setErrorCode (errorCode_t ec) |
Client socket that connects to a server socket over TCP.
The server socket's IP address and port should be given.
Definition at line 50 of file TCPClientSocket.h.
hu::varadiistvan::scpl::io::TCPClientSocket::TCPClientSocket | ( | struct in_addr | address, |
unsigned short | port, | ||
Waiter * | waiter = 0 , |
||
size_t | readingCapacity = DEFAULT_CAPACITY , |
||
size_t | writingCapacity = DEFAULT_CAPACITY |
||
) |
Construct the client socket with the given address and port number.
address | the address of the server socket |
port | the address of the server socket |
waiter | the waiter to use for waiting a possible event occuring on the socket. If given, the socket will be non-blocking. Otherwise, it will be blocking, and the connect() function of the Connector might block as well as the reading and writing buffers. |
readingCapacity | the capacity of the reading buffer |
writingCapacity | the capacity of the writing buffer |
hu::varadiistvan::scpl::io::TCPClientSocket::TCPClientSocket | ( | const char * | address, |
unsigned short | port, | ||
Waiter * | waiter = 0 , |
||
size_t | readingCapacity = DEFAULT_CAPACITY , |
||
size_t | writingCapacity = DEFAULT_CAPACITY |
||
) |
Construct the client socket with the given address and port number.
address | the address of the server socket expressed as a string |
port | the address of the server socket |
waiter | the waiter to use for waiting a possible event occuring on the socket. If given, the socket will be non-blocking. Otherwise, it will be blocking, and the connect() function of the Connector might block as well as the reading and writing buffers. |
readingCapacity | the capacity of the reading buffer |
writingCapacity | the capacity of the writing buffer |
TCPConnector& hu::varadiistvan::scpl::io::TCPClientSocket::getConnector | ( | ) |
Get the connector. Use this object to connect to another socket.