Dart Telnet Control
Close Method
Description
Close the session and release all system resources. A single control can be used for many connections, one after the other.
Syntax
Visual Basic
Public Sub Close() 
Remarks

Use this method only when the State property is tcpConnected; otherwise, a ptNotConnected error is generated.

If Blocked and you wish to cancel the blocking method and release resources, use the Abort method. Using Close when another method is blocking results in a ptBlocked error.

The Abort method performs a "hard close", with a socket LINGER option time of 0. Use Abort instead of Close to prevent the socket from entering a WAIT_STATE and to immediately release it for reuse.

If Timeout is greater than 0, then this method attempts to clear all buffers and performs a graceful close on the socket within the timeout period. The "close socket" system call blocks while closing. If the operation completes within the timeout period, then this method returns successfully. If the operation does not complete within the timeout period (if SendBufferCount is large, for example), then resources are immediately released and a ptTimeout error is generated.

If Timeout is 0, then a non-blocking "close socket" system call is used with the DONTLINGER option set.

The State property is tcpClosed when closing is complete.

Error Codes

This method may generate the following error code (refer to ErrorConstants for a complete list of error codes):

See Also

Telnet Object  | Telnet Members


Documentation Version 1.9.3.0
© 2020 Dart Communications. All Rights Reserved.
Send comments on this topic