Very Simple Cross-Platform Library
Public Member Functions | List of all members
hu::varadiistvan::scpl::io::TCPClientSocket Class Reference

#include <TCPClientSocket.h>

Inheritance diagram for hu::varadiistvan::scpl::io::TCPClientSocket:
hu::varadiistvan::scpl::io::BufferedStream hu::varadiistvan::scpl::io::Failable

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)
 
TCPConnectorgetConnector ()
 
- Public Member Functions inherited from hu::varadiistvan::scpl::io::BufferedStream
virtual ~BufferedStream ()
 
ReadingBuffergetReadingBuffer ()
 
WritingBuffergetWritingBuffer ()
 
- 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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TCPClientSocket() [1/2]

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.

Parameters
addressthe address of the server socket
portthe address of the server socket
waiterthe 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.
readingCapacitythe capacity of the reading buffer
writingCapacitythe capacity of the writing buffer

◆ TCPClientSocket() [2/2]

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.

Parameters
addressthe address of the server socket expressed as a string
portthe address of the server socket
waiterthe 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.
readingCapacitythe capacity of the reading buffer
writingCapacitythe capacity of the writing buffer

Member Function Documentation

◆ getConnector()

TCPConnector& hu::varadiistvan::scpl::io::TCPClientSocket::getConnector ( )

Get the connector. Use this object to connect to another socket.


The documentation for this class was generated from the following file: