| UDT Reference: UDT Structures |
The structures used in UDT API are listed in the table below:
| Structures | Comments |
|---|---|
|
UDT socket descriptor |
|
|
read the system errno of the exception |
|
|
set of UDT sockets |
|
|
read the text description of the exception |
|
|
definition of memory processing function for overlapped IO |
This is used as the descriptor of a UDT socket. Its internal is not exposed to application and subject to future changes.
The ERRORINFO structure contains the specific information of a UDT error. It has two helper functions to let applications know an integral error code and a piece of text information.
| Functions | Functionality |
|---|---|
|
int getErrorCode() |
read the UDT error code. |
|
const char* getErrorMessage() |
read the text error information. |
The UDSET is used with select call to access multiple UDT descriptors.
Four macros are defined on the UDSET structure to processing a UDT socket set. They are very similar to the fd_set structure and macros in traditional standard socket API.
| Macros | Functionality |
|---|---|
|
UD_CLR(u, *set) |
Removes the descriptor u from set. |
|
UD_ISSET(u, *set) |
Nonzero if u is a member of the set. Otherwise, zero. |
|
UD_SET(u, *set) |
Adds descriptor u to set. |
|
UD_ZERO(*set) |
Initializes the set to null. |
The TRACEINFO structure stores the performance trace information. Its member attributes can be read directly by applications.
| Members | Comments |
|---|---|
|
The following attributes are aggregate values since the UDT socket is created. |
|
|
int64_t msTimeStamp |
time elapsed since the UDT socket is created, in milliseconds |
|
int64_t pktSentTotal |
total number of sent packets, including retransmissions |
|
int64_t pktRecvTotal |
total number of received packets |
|
int pktSndLossTotal |
total number of lost packets, measured in the sending side |
|
int pktRcvLossTotal |
total number of lost packets, measured in the receiving side |
|
int pktRetransTotal |
total number of retransmitted packets, measured in the sending side |
|
int pktSentACKTotal |
total number of sent ACK packets |
|
int pktRecvACKTotal |
total number of received ACK packets |
|
int pktSentNAKTotal |
total number of sent NAK packets |
|
int pktRecvNAKTotal |
total number of received NAK packets |
| The following attributes are local values since the last time they are recorded. | |
|
int64_t pktSent |
number of sent packets, including retransmissions |
|
int64_t pktRecv |
number of received packets |
|
int pktSndLoss |
number of lost packets, measured in the sending side |
|
int pktRcvLoss |
number of lost packets, measured in the receiving side |
|
int pktRetrans |
number of retransmitted packets, measured in the sending side |
|
int pktSentACK |
number of sent ACK packets |
|
int pktRecvACK |
number of received ACK packets |
|
int pktSentNAK |
number of sent NAK packets |
|
int pktRecvNAK |
number of received NAK packets |
|
double mbpsSendRate |
sending rate in Mbps |
|
double mbpsRecvRate |
receiving rate in Mbps |
| The following attributes are instant values at the time they are observed. | |
|
double usPktSndPeriod |
packet sending period, in microseconds |
|
int pktFlowWindow |
flow window size, in number of packets |
|
int pktCongestionWindow |
congestion window size, in number of packets |
|
int pktFlightSize |
number packets on the flight |
|
double msRTT |
round trip time, in milliseconds |
|
double mbpsBandwidth |
estimated bandwidth, in Mbps |
|
int byteAvailSndBuf |
available sending buffer size, in bytes |
|
int byteAvailRcvBuf |
available receiving buffer size, in bytes |
The UDT_MEM_ROUTINE is defined as void (UDT_MEME_ROUTINE*)(char*, int, void*) and it is used to automatically process the data buffer after an overlapped IO is completed. The first parameter is a pointer to the buffer to be processed, the second parameter is the length of the buffer, and the last parameter is a pointer to the application context.