UDT Reference: CUDT Methods |
The close method closes the UDT entity.
enum CUDT::CL_STATUS {WAIT_NONE, WAIT_SEND, WAIT_RECV, WAIT_ALL}; void close( CUDT::CL_STATUS wait = WAIT_NONE ); |
NONE.
No exception will be caused.
The close method closes the UDT entity. It disconnects the connection, stops the sending and receiving thread and destroys all data structures. It SHOULD be called before a UDT entity is to be destroyed.
The method will return immediately with default WAIT_NONE parameter. If WAIT_SEND is set, all data in the sending buffer will be sent before UDT is closed. If WAIT_RECV is set, all data are still in transfer will be finished before UDT is closed. The option of WAIT_ALL is the combination of WAIT_SEND and WAIT_RECV.
A closed UDT entity can be opened again by a open method.
Nothing happens if the UDT entity was not opened.