C++ IP API
9.5.8
TCP & UDP for virtual user scripts
|
A factory class for the creation of TcpClientConnection and TcpConnection objects. More...
Public Methods | |
TcpConnectionFactory (VirtualUserInterface *vu, LockableLog *log, TcpFactoryProperties *properties) | |
The constructor. Not called directly by test scripts. More... | |
virtual | ~TcpConnectionFactory () |
Public Methods For creation of connections | |
TcpClientConnection | createClient (const IpEndPoint &remoteIpEndPoint, bool secure=false) |
Create a TcpClientConnection object. More... | |
TcpClientConnection | createClient (const IpEndPoint &localIpEndPoint, const IpEndPoint &remoteIpEndPoint, bool secure=false) |
Create a viable TcpClientConnection object. More... | |
TcpConnection | waitForConnection (const IpEndPoint &localIpEndPoint, bool secure=false) |
Wait for an incoming TCP connection and then create a viable TcpConnection object. More... | |
Public Properties | |
Default properties passed to TcpClientConnection and TcpConnection objects on creation.
| |
int | getConnectRetries () const |
Get the number of times a connection request will be retried if unsuccessful. More... | |
void | setConnectRetries (int retries) |
Set the number of times a connection request will be retried if unsuccessful. More... | |
int | getBufferSize () const |
Get the size of the buffer used to receive data from the network. More... | |
void | setBufferSize (int bufferSize) |
int | getDnsTimeout () const |
Set the current buffer size. More... | |
void | setDnsTimeout (int timeout) |
Set the DNS look up timeout value (the maximum time that will be spent looking up an IP address). More... | |
int | getDnsRetries () const |
Get the number of times a DNS lookup is attempted before giving up. More... | |
void | setDnsRetries (int retries) |
Set the number of DNS lookup retries that can be made. More... | |
int | getConnectTimeout () const |
Get the maximum time to be spent waiting for the response to a connection request. More... | |
void | setConnectTimeout (int timeout) |
Set the maximum time to be spent waiting for the response to a connection request. More... | |
int | getReceiveTimeout () const |
Get the the maximum time to be spent waiting for data to satisfy a receive/discard request More... | |
void | setReceiveTimeout (int timeout) |
Set the receive timeout. More... | |
int | getSendTimeout () const |
Get the timeout used whilst waiting for data to be sent. More... | |
void | setSendTimeout (int timeout) |
Set the send timeout. More... | |
bool | isLoggingEnabled () const |
Read only, indicates if logging is enabled. More... | |
DataRatePacer & | getDataRate () const |
Get the maximum rate (kilobits per second) at which data will be transferred over this connection. A negative value or 0 means no limit. This feature provides a basic and unsophisticated way of simulating traffic over slow networks and this type of simulation is no match for dedicated network simulation tools. More... | |
void | setDataRate (int dataRate) |
Set the maximum rate (kilobits per second) at which data will be transferred over this connection. A negative value or 0 means no limit. This feature provides a basic and unsophisticated way of simulating traffic over slow networks and this type of simulation is no match for dedicated network simulation tools. More... | |
Further Public Properties | |
Properties of this factory. Return the time in milliseconds that this factory will wait for an incoming connection request on the live network. | |
int | getListenTimeout () const |
void | setListenTimeout (int timeout) |
Set the time in milliseconds this factory will wait for an in incoming connection request on the live network. More... | |
A factory class for the creation of TcpClientConnection and TcpConnection objects.
Objects of this class are not created directly by the user, but accessed via IpScript or IpVirtualUser.
Facilita::TcpConnectionFactory::TcpConnectionFactory | ( | VirtualUserInterface * | vu, |
LockableLog * | log, | ||
TcpFactoryProperties * | properties | ||
) |
The constructor. Not called directly by test scripts.
|
virtual |
TcpClientConnection Facilita::TcpConnectionFactory::createClient | ( | const IpEndPoint & | remoteIpEndPoint, |
bool | secure = false |
||
) |
Create a TcpClientConnection object.
The local IP address and port are not specified. This means the Operating System will assign them.
remoteIpEndPoint | The remote IP address and port to connect to. |
secure | If true use SSL to encrypt data sent and received. |
TcpClientConnection Facilita::TcpConnectionFactory::createClient | ( | const IpEndPoint & | localIpEndPoint, |
const IpEndPoint & | remoteIpEndPoint, | ||
bool | secure = false |
||
) |
Create a viable TcpClientConnection object.
localIpEndPoint | The local IP address and port to bind to. |
remoteIpEndPoint | The remote IP address and port to connect to. |
secure | If true use SSL to encrypt data sent and received. |
int Facilita::TcpConnectionFactory::getBufferSize | ( | ) | const |
Get the size of the buffer used to receive data from the network.
int Facilita::TcpConnectionFactory::getConnectRetries | ( | ) | const |
Get the number of times a connection request will be retried if unsuccessful.
int Facilita::TcpConnectionFactory::getConnectTimeout | ( | ) | const |
Get the maximum time to be spent waiting for the response to a connection request.
DataRatePacer& Facilita::TcpConnectionFactory::getDataRate | ( | ) | const |
Get the maximum rate (kilobits per second) at which data will be transferred over this connection. A negative value or 0 means no limit. This feature provides a basic and unsophisticated way of simulating traffic over slow networks and this type of simulation is no match for dedicated network simulation tools.
int Facilita::TcpConnectionFactory::getDnsRetries | ( | ) | const |
Get the number of times a DNS lookup is attempted before giving up.
int Facilita::TcpConnectionFactory::getDnsTimeout | ( | ) | const |
Set the current buffer size.
bufferSize | The number of bytes to set the buffer size. |
Get the DNS look up timeout value (the maximum time that will be spent looking up an IP address).
int Facilita::TcpConnectionFactory::getListenTimeout | ( | ) | const |
int Facilita::TcpConnectionFactory::getReceiveTimeout | ( | ) | const |
Get the the maximum time to be spent waiting for data to satisfy a receive/discard request
int Facilita::TcpConnectionFactory::getSendTimeout | ( | ) | const |
Get the timeout used whilst waiting for data to be sent.
bool Facilita::TcpConnectionFactory::isLoggingEnabled | ( | ) | const |
Read only, indicates if logging is enabled.
void Facilita::TcpConnectionFactory::setBufferSize | ( | int | bufferSize | ) |
void Facilita::TcpConnectionFactory::setConnectRetries | ( | int | retries | ) |
Set the number of times a connection request will be retried if unsuccessful.
retries | Set this number of retries. |
void Facilita::TcpConnectionFactory::setConnectTimeout | ( | int | timeout | ) |
Set the maximum time to be spent waiting for the response to a connection request.
timeout | The timeout value in milliseconds. |
void Facilita::TcpConnectionFactory::setDataRate | ( | int | dataRate | ) |
Set the maximum rate (kilobits per second) at which data will be transferred over this connection. A negative value or 0 means no limit. This feature provides a basic and unsophisticated way of simulating traffic over slow networks and this type of simulation is no match for dedicated network simulation tools.
dataRate | The rate expressed as kilobits per second. |
void Facilita::TcpConnectionFactory::setDnsRetries | ( | int | retries | ) |
Set the number of DNS lookup retries that can be made.
retries | The number retries that can be made on a DNS look up. |
void Facilita::TcpConnectionFactory::setDnsTimeout | ( | int | timeout | ) |
Set the DNS look up timeout value (the maximum time that will be spent looking up an IP address).
timeout | The DNS look up timeout in milliseconds. |
void Facilita::TcpConnectionFactory::setListenTimeout | ( | int | timeout | ) |
Set the time in milliseconds this factory will wait for an in incoming connection request on the live network.
void Facilita::TcpConnectionFactory::setReceiveTimeout | ( | int | timeout | ) |
Set the receive timeout.
timeout | The timeout value in milliseconds. |
void Facilita::TcpConnectionFactory::setSendTimeout | ( | int | timeout | ) |
Set the send timeout.
timeout | The new timeout value in milliseconds. |
TcpConnection Facilita::TcpConnectionFactory::waitForConnection | ( | const IpEndPoint & | localIpEndPoint, |
bool | secure = false |
||
) |
Wait for an incoming TCP connection and then create a viable TcpConnection object.
localIpEndPoint | The local IP address and port to bind to and wait for incoming connection calls. |
secure | If true use SSL to encrypt data sent and received. |