SecureTcp Object : State Event |
Visual Basic |
---|
Public Event State() |
WARNING Timeout must be 0 when calling methods from within an event. Failure to observe this rule may cause reentrancy problems and unpredictable results.
The Connect method (used to initiate an active connection) normally causes the State property to transition from tcpClosed to tcpConnecting (while resources are being allocated and the connection is being established) to tcpConnected, at which time communications activity can start.
When the Socket property is set to manage a connection that was accepted by the Daemon Control, the State property immediately transitions from tcpClosed to tcpConnected, at which time communications activity can start.
The Close method normally causes the State property to transition from tcpConnected to tcpClosing (while resources are being de-allocated) to tcpClosed.
When the remote host closes the connection, there may still be data available in the stream. In this case, the State property is tcpClosing until all the data is received and the socket returns a 0 value (using the Receive, Fill, or Search method), after which the State property changes to tcpClosed.