37 TcpClient(
const std::string & hostname,
int port,
int timeoutInMillisecons = 0);
50 void connect(
const std::string & hostname,
int port,
int timeoutInMillisecons = 0);
84 void send(
const std::string & value);
87 void send(
const void * buffer,
size_t bufferLength);
98 const Bytes &
receive(
size_t numberOfBytesToReceive,
int timeoutInMillisecons = 0);
#define ONIXS_FIXENGINE_API
~TcpClient(void)
The destructor.
const Bytes & receive(int timeoutInMillisecons=0)
Receives the data.
void noDelay(bool setTcpNoDelayOption)
Sets a value that disables a delay when send or receive buffers are not full.
TcpClient()
Initializes a new instance of the TcpClient class.
void connect(const std::string &hostname, int port, int timeoutInMillisecons=0)
Connects to the specified port on the specified host.
int receiveBufferSize() const
Returns the size of the TCP buffer allocated to the TCP connection for the receiving data.
void close()
Closes the TCP connection.
void sendBufferSize(int size)
Sets the size of the TCP buffer allocated to the TCP connection for the sending data.
void send(const std::string &value)
Sends the given value.
int sendBufferSize() const
Returns the size of the TCP buffer allocated to the TCP connection for the sending data.
TcpClient(const std::string &hostname, int port, int timeoutInMillisecons=0)
Initializes a new instance of the TcpClient class and connects to the specified port on the specified...
Handle socketHandle()
Returns the socket handle which the TCP connection uses to transmit data.
const Bytes & receive(size_t numberOfBytesToReceive, int timeoutInMillisecons=0)
Receives exactly the given number of bytes.
void receiveBufferSize(int size)
Sets the size of the TCP buffer allocated to the TCP connection for the receiving data.
static const Handle InvalidSocketHandle
void send(const void *buffer, size_t bufferLength)
Sends the given value.
bool noDelay() const
Gets a value that disables a delay when send or receive buffers are not full.
int Handle
Type alias for socket handle.
std::vector< Byte > Bytes
Sequence of bytes.