UDT Reference: Functions

#### perfmon

The perfmon method retrieves the internal protocol parameters and performance trace.

int perfmon(
UDTSOCKET u,
TRACEINFO* perf,
bool clear = true
);

##### Parameters

u
  [in] Descriptor identifying a UDT entity.
trace
  [out] Pointer to the TRACEINFO structure to store the performance information.
clear
  [in] Flag that indicates if the local traces should be cleared and counts should be restarted.

##### Return Value

If success, 0 is returned and trace information is written into trace; otherwise, UDT::ERROR is returned and specific error information can be retrieved by getlasterror.

Error Name | Error Code | Comment
ECONNLOST | 2001 | connection is broken.
EINVSOCK | 5004 | u is an invalid socket.
EUNBOUNDSOCK | 5005 | u is not connected.

##### Description

The perfmon method reads the performance data since the last time perfmon is executed, or since the connection is started. The result in written into a TRACEINFO structure.

There are three kinds of performance information that can be read by applications: the total counts since the connection is started, the periodical counts since last time the counts are cleared, and instant parameter values.