C++ IP API  9.5.8
TCP & UDP for virtual user scripts
Facilita::UdpLink Class Reference

More...

Inheritance diagram for Facilita::UdpLink:
Collaboration diagram for Facilita::UdpLink:

Public Methods

 UdpLink ()
 Default constructor. More...
 
 UdpLink (const UdpLink &other)
 Copy constructor. More...
 
virtual ~UdpLink ()
 
void close ()
 Explicitly close the communications layer associated to this object. More...
 
bool isLoggingEnabled () const
 This read only property indicates if logging is enabled. More...
 
int maxUdpSize () const
 Return the permitted maximum data content of a UDP packet on this network. More...
 
UdpLinkoperator= (UdpLink &other)
 Assignment operator for this class. More...
 
ReceiveResponse receive ()
 Receive data from the remote IpEndPoint. More...
 
int send (const string &text, int reference=0)
 Send data to the remote IpEndPoint. More...
 
UdpLink withRemoteIpEndPoint (const IpEndPoint &remoteIpEndPoint)
 Construct another UdpLink with a different remote endpoint. More...
 
Public Properties

Properties that affect behaviour.

int getSendRetries () const
 Return the maximum number of attempts that will be made to send some data. More...
 
void setSendRetries (int retries)
 Set the maximum number of attempts that will be made to send some data. More...
 
int getBufferSize () const
 Return the size of the buffer used to receive data from the network. It should be less than or equal to maxUdpSize. More...
 
void setBufferSize (int bufferSize)
 Set the current buffer size. More...
 
int getDnsTimeout () const
 Get the DNS look up timeout value (the maximum time that will be spent looking up an IP address) 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 retries made on a DNS lookup before giving up. More...
 
void setDnsRetries (int retries)
 Set the number of DNS lookup retries that can be made. More...
 
int getReceiveTimeout () const
 Get the receive timeout value (the maximum wait time when attempting to receive data. More...
 
void setReceiveTimeout (int timeout)
 Set the receive timeout. More...
 
int getLinkTimeout () const
 Get the maximum time spent waiting for a UdpLink on a waitForLink waitForLink. More...
 
void setLinkTimeout (int timeout)
 Set the link timeout. More...
 
IpEndPoint getRemoteIpEndPoint () const
 This read only property indicates the remote IpEndPoint. More...
 
IpEndPoint getLocalIpEndPoint () const
 This read only property indicates the local IpEndPoint. More...
 
void suspendLogging ()
 
void resumeLogging ()
 
string toString () const
 Short string describing this object. More...
 
int getLinkNumber () const
 

Detailed Description

Represents a local UDP protocol endpoint paired with a remote endpoint between which data can be exchanged. Provides methods for sending and receiving data that are designed for use in test scripts.

UdpLinkImpl objects are not created directly, use IpScript or IpVirtualUser factory methods. A UdpLink references two IpEndPoints that define a peer to peer relationship. Typically a UDP client is represented by a UdpLink object with a specific remote IP address and port. The local IP address and port may be left unspecified, to be assigned by the Operating System. Alternatively the local address may be explicitly defined, in which case IP address may be configured by IP spoofing.

Objects of this class are safe to be copied and re-assigned. They are not thread-safe.

Constructors

Facilita::UdpLink::UdpLink ( )

Default constructor.

Facilita::UdpLink::UdpLink ( const UdpLink other)

Copy constructor.

virtual Facilita::UdpLink::~UdpLink ( )
virtual

Methods

void Facilita::UdpLink::close ( )

Explicitly close the communications layer associated to this object.

Sending or receiving (if valid to do so) will implicitly re-open the communications layer.

int Facilita::UdpLink::getBufferSize ( ) const

Return the size of the buffer used to receive data from the network. It should be less than or equal to maxUdpSize.

Returns
The current buffer size.
int Facilita::UdpLink::getDnsRetries ( ) const

Get the number of retries made on a DNS lookup before giving up.

Returns
The current number of retries that would be made.
int Facilita::UdpLink::getDnsTimeout ( ) const

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::UdpLink::getLinkNumber ( ) const
Returns
The unique number identifying this UdpLink.
int Facilita::UdpLink::getLinkTimeout ( ) const

Get the maximum time spent waiting for a UdpLink on a waitForLink waitForLink.

Returns
The current timeout in milliseconds.
IpEndPoint Facilita::UdpLink::getLocalIpEndPoint ( ) const

This read only property indicates the local IpEndPoint.

Returns
The local IpEndPoint.
int Facilita::UdpLink::getReceiveTimeout ( ) const

Get the receive timeout value (the maximum wait time when attempting to receive data.

Returns
The current timeout in milliseconds.
IpEndPoint Facilita::UdpLink::getRemoteIpEndPoint ( ) const

This read only property indicates the remote IpEndPoint.

Returns
The remote IpEndPoint.
int Facilita::UdpLink::getSendRetries ( ) const

Return the maximum number of attempts that will be made to send some data.

Returns
The retry limit.
bool Facilita::UdpLink::isLoggingEnabled ( ) const

This read only property indicates if logging is enabled.

Returns
True if logging enabled else false.
int Facilita::UdpLink::maxUdpSize ( ) const

Return the permitted maximum data content of a UDP packet on this network.

It is the maximum buffer size you can send or receive and is defined by the underlying network.

Returns
Maximum data size of a UDP packet.
UdpLink& Facilita::UdpLink::operator= ( UdpLink other)

Assignment operator for this class.

Returns
The this object.
ReceiveResponse Facilita::UdpLink::receive ( )

Receive data from the remote IpEndPoint.

Exceptions
FatalCommunicationExceptionthrown when the underlying communications fails.
Returns
ReceiveResponse.
void Facilita::UdpLink::resumeLogging ( )
int Facilita::UdpLink::send ( const string &  text,
int  reference = 0 
)

Send data to the remote IpEndPoint.

Parameters
textThe string to send.
referenceAn (optional) reference number that can be used to identify the link instance.
Exceptions
FatalCommunicationExceptionthrown when the underlying communications fails.
Returns
The number of bytes sent.
void Facilita::UdpLink::setBufferSize ( int  bufferSize)

Set the current buffer size.

Parameters
bufferSizeThe number of bytes to set the buffer size.
void Facilita::UdpLink::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::UdpLink::setDnsTimeout ( int  timeout)

Set the DNS look up timeout value (the maximum time that will be spent looking up an IP address).

Parameters
timeoutThe timeout value in milliseconds.
void Facilita::UdpLink::setLinkTimeout ( int  timeout)

Set the link timeout.

Parameters
timeoutThe timeout value in milliseconds.
void Facilita::UdpLink::setReceiveTimeout ( int  timeout)

Set the receive timeout.

Parameters
timeoutThe timeout value in milliseconds.
void Facilita::UdpLink::setSendRetries ( int  retries)

Set the maximum number of attempts that will be made to send some data.

Parameters
retriesThe retry limit.
void Facilita::UdpLink::suspendLogging ( )
string Facilita::UdpLink::toString ( ) const

Short string describing this object.

Returns
The string describing this object.
UdpLink Facilita::UdpLink::withRemoteIpEndPoint ( const IpEndPoint remoteIpEndPoint)

Construct another UdpLink with a different remote endpoint.

All attributes are the same except the remote IpEndPoint.

Parameters
remoteIpEndPointThe remote IpEntPoint for the newly constructed UdpLink.
Returns
A newly constructed Facilita::UdpLink.

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