C++ IP API  9.5.5
TCP & UDP for virtual user scripts
Facilita::TcpConnectionFactory Class Reference

A factory class for the creation of TcpClientConnection and TcpConnection objects. More...

Inheritance diagram for Facilita::TcpConnectionFactory:
Collaboration diagram for Facilita::TcpConnectionFactory:

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.

See also
TcpConnections.
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...
 

Detailed Description

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.

Constructors

Facilita::TcpConnectionFactory::TcpConnectionFactory ( VirtualUserInterface *  vu,
LockableLog *  log,
TcpFactoryProperties *  properties 
)

The constructor. Not called directly by test scripts.

virtual Facilita::TcpConnectionFactory::~TcpConnectionFactory ( )
virtual

Methods

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.

Parameters
remoteIpEndPointThe remote IP address and port to connect to.
secureIf true use SSL to encrypt data sent and received.
Returns
A TcpClientConnection.
TcpClientConnection Facilita::TcpConnectionFactory::createClient ( const IpEndPoint localIpEndPoint,
const IpEndPoint remoteIpEndPoint,
bool  secure = false 
)

Create a viable TcpClientConnection object.

Parameters
localIpEndPointThe local IP address and port to bind to.
remoteIpEndPointThe remote IP address and port to connect to.
secureIf true use SSL to encrypt data sent and received.
Returns
A TcpClientConnection.
int Facilita::TcpConnectionFactory::getBufferSize ( ) const

Get the size of the buffer used to receive data from the network.

Returns
The current buffer size.
int Facilita::TcpConnectionFactory::getConnectRetries ( ) const

Get the number of times a connection request will be retried if unsuccessful.

Returns
The current number of retries.
int Facilita::TcpConnectionFactory::getConnectTimeout ( ) const

Get the maximum time to be spent waiting for the response to a connection request.

Returns
The current timeout in milliseconds.
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.

Returns
A reference to the current DataRatePacer.
int Facilita::TcpConnectionFactory::getDnsRetries ( ) const

Get the number of times a DNS lookup is attempted before giving up.

Returns
The current maximum number of retries that can be made.
int Facilita::TcpConnectionFactory::getDnsTimeout ( ) const

Set the current buffer size.

Parameters
bufferSizeThe 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).

Returns
The timeout value in milliseconds.
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

Returns
The current timeout in milliseconds.
int Facilita::TcpConnectionFactory::getSendTimeout ( ) const

Get the timeout used whilst waiting for data to be sent.

Returns
The current timeout.
bool Facilita::TcpConnectionFactory::isLoggingEnabled ( ) const

Read only, indicates if logging is enabled.

Returns
True if logging enabled else false.
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.

Parameters
retriesSet 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.

Parameters
timeoutThe 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.

Parameters
dataRateThe rate expressed as kilobits per second.
void Facilita::TcpConnectionFactory::setDnsRetries ( int  retries)

Set the number of DNS lookup retries that can be made.

Parameters
retriesThe 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).

Parameters
timeoutThe 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.

Parameters
timeoutThe timeout value in milliseconds.
void Facilita::TcpConnectionFactory::setSendTimeout ( int  timeout)

Set the send timeout.

Parameters
timeoutThe 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.

Parameters
localIpEndPointThe local IP address and port to bind to and wait for incoming connection calls.
secureIf true use SSL to encrypt data sent and received.
Returns
A TcpClientConnection.

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