UDT Reference: UDT Functions |
The getoverlappedresult method retrieves the status of an overlapped IO.
bool getoverlappedresult( |
If wait is true, true is returned for a success call - the IO is completed; otherwise false is returned if there are errors. The specific error information can be found by getlasterror.
If wait is false, true is returned if the IO has been completed. If the IO is still in progress, false is returned, and the number of bytes transferred is indicated in progress. A returned value of false can also indicates errors, in which case the progress is set to -1.
Error Code | Comment |
---|---|
2001 |
connection is broken before the IO completes. |
2002 | connection does not exist. |
5003 |
no overlapped IO is associated with the given handle. |
5004 |
u is an invalid UDT socket. |
The getoverlappedresult method retrieves the status of an overlapped IO associated with the handle. If wait is true, this method will wait until the IO is completed. Otherwise it returns immediately and indicates the IO progress in progress.
Note: In the current implementation, IO handle cannot be verified. If an invalid handle is passed to the call, true is always returned and the progress will be zero. That is, when this method returns true, the value of progress is meaningless. On the other hand, if the method returns false, the value of progress should be check to see if there are errors or the IO is not completed.