C++ IP API
9.5.8
TCP & UDP for virtual user scripts
|
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... | |
UdpLink & | operator= (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 |
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.
Facilita::UdpLink::UdpLink | ( | ) |
Default constructor.
Facilita::UdpLink::UdpLink | ( | const UdpLink & | other | ) |
Copy constructor.
|
virtual |
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.
int Facilita::UdpLink::getDnsRetries | ( | ) | const |
Get the number of retries made on a DNS lookup before giving up.
int Facilita::UdpLink::getDnsTimeout | ( | ) | const |
Get the DNS look up timeout value (the maximum time that will be spent looking up an IP address)
int Facilita::UdpLink::getLinkNumber | ( | ) | const |
int Facilita::UdpLink::getLinkTimeout | ( | ) | const |
Get the maximum time spent waiting for a UdpLink on a waitForLink waitForLink.
IpEndPoint Facilita::UdpLink::getLocalIpEndPoint | ( | ) | const |
This read only property indicates the local IpEndPoint.
int Facilita::UdpLink::getReceiveTimeout | ( | ) | const |
Get the receive timeout value (the maximum wait time when attempting to receive data.
IpEndPoint Facilita::UdpLink::getRemoteIpEndPoint | ( | ) | const |
This read only property indicates the remote IpEndPoint.
int Facilita::UdpLink::getSendRetries | ( | ) | const |
Return the maximum number of attempts that will be made to send some data.
bool Facilita::UdpLink::isLoggingEnabled | ( | ) | const |
This read only property indicates if logging is enabled.
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.
Assignment operator for this class.
ReceiveResponse Facilita::UdpLink::receive | ( | ) |
Receive data from the remote IpEndPoint.
FatalCommunicationException | thrown when the underlying communications fails. |
void Facilita::UdpLink::resumeLogging | ( | ) |
int Facilita::UdpLink::send | ( | const string & | text, |
int | reference = 0 |
||
) |
Send data to the remote IpEndPoint.
text | The string to send. |
reference | An (optional) reference number that can be used to identify the link instance. |
FatalCommunicationException | thrown when the underlying communications fails. |
void Facilita::UdpLink::setBufferSize | ( | int | bufferSize | ) |
Set the current buffer size.
bufferSize | The 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.
retries | The 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).
timeout | The timeout value in milliseconds. |
void Facilita::UdpLink::setLinkTimeout | ( | int | timeout | ) |
Set the link timeout.
timeout | The timeout value in milliseconds. |
void Facilita::UdpLink::setReceiveTimeout | ( | int | timeout | ) |
Set the receive timeout.
timeout | The timeout value in milliseconds. |
void Facilita::UdpLink::setSendRetries | ( | int | retries | ) |
Set the maximum number of attempts that will be made to send some data.
retries | The retry limit. |
void Facilita::UdpLink::suspendLogging | ( | ) |
string Facilita::UdpLink::toString | ( | ) | const |
Short 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.
remoteIpEndPoint | The remote IpEntPoint for the newly constructed UdpLink. |