The structures used in UDT API are listed in the table below:
Structures | Comments |
UDTSOCKET | UDT socket descriptor |
ERRORINFO | Description of UDT system errors |
UDSET | Set of UDT sockets |
TRACEINFO | UDT performance statistics and protocol parameters |
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 | Comments |
int getErrorCode() | read the UDT error code |
const char* getErrorMessage() | read the text information about the error. |
void clear() | clear the error information (set to SUCCESS). |
The UDSET structure 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 | Comments |
UD_CLR(u, *set) | remove socket u from set. |
UD_ISSET(u, *set) | check if u is in set. |
UD_SET(u, *set) | add u into the set. |
UD_ZERO(*set) | initialize set to empty. |
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 pktSent | number of sent packets, including retransmissions |
int64 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 |