#include <OnixS/FIXEngine/Sockets/TcpClient.h>
Definition at line 29 of file TcpClient.h.
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 host.
- Parameters
-
hostname | The DNS name of the remote host to which you intend to connect (or its IP address). |
port | The port number of the remote host to which you intend to connect. |
timeoutInMillisecons | The timeout value in milliseconds. If 0 then the method blocks until some data is received. |
Initializes a new instance of the TcpClient class.
Closes the TCP connection.
void connect |
( |
const std::string & |
hostname, |
|
|
int |
port, |
|
|
int |
timeoutInMillisecons = 0 |
|
) |
| |
Connects to the specified port on the specified host.
- Parameters
-
hostname | The DNS name of the remote host to which you intend to connect (or its IP address). |
port | The port number of the remote host to which you intend to connect. |
timeoutInMillisecons | The timeout value in milliseconds. If 0 then the method blocks until some data is received. |
void noDelay |
( |
bool |
setTcpNoDelayOption | ) |
|
Sets a value that disables a delay when send or receive buffers are not full.
When the setTcpNoDelayOption is false, a TcpClient does not send a packet over the network until it has collected a significant amount of the outgoing data. Because of the amount of overhead in a TCP segment, sending small amounts of data is inefficient. However, situations do exist where you need to send very small amounts of data or expect immediate responses from each packet you send. Your decision should weigh the relative importance of network efficiency versus application requirements.
Gets a value that disables a delay when send or receive buffers are not full.
const Bytes& receive |
( |
int |
timeoutInMillisecons = 0 | ) |
|
Receives the data.
- Parameters
-
timeoutInMillisecons | The timeout value in milliseconds. If 0 then the method blocks until some data is received. |
const Bytes& receive |
( |
size_t |
numberOfBytesToReceive, |
|
|
int |
timeoutInMillisecons = 0 |
|
) |
| |
Receives exactly the given number of bytes.
- Parameters
-
numberOfBytesToReceive | The number of bytes to received. |
timeoutInMillisecons | The timeout value in milliseconds. If 0 then the method blocks until all bytes are received. |
int receiveBufferSize |
( |
| ) |
const |
Returns the size of the TCP buffer allocated to the TCP connection for the receiving data.
void receiveBufferSize |
( |
int |
size | ) |
|
Sets the size of the TCP buffer allocated to the TCP connection for the receiving data.
void send |
( |
const std::string & |
value | ) |
|
void send |
( |
const void * |
buffer, |
|
|
size_t |
bufferLength |
|
) |
| |
int sendBufferSize |
( |
| ) |
const |
Returns the size of the TCP buffer allocated to the TCP connection for the sending data.
void sendBufferSize |
( |
int |
size | ) |
|
Sets the size of the TCP buffer allocated to the TCP connection for the sending data.
Returns the socket handle which the TCP connection uses to transmit data.
const Handle InvalidSocketHandle |
|
static |
The documentation for this class was generated from the following file: