Discuss this help topic in SecureBlackbox Forum

TElBaseSocketClient.Active

TElBaseSocketClient     See also     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


Specifies whether the session has been established and the data can be sent and received.

Declaration

[C#]
    bool Active;

[VB.NET]
    Property Active As Boolean

[Pascal]
    property Active : boolean;

[C++]
    bool get_Active();

[PHP]
    bool get_Active()

[Java]
    boolean getActive();

Description

This read-only property returns True if the session was established and the client can send data. If the client can't send data now, False is returned. It is important to check this property prior to sending data.

Due to the specific design of TCP/IP protocol, there is no way to find out that the connection is closed if it has been lost on the socket level. In such case, Active can still return True. The only way to check the actual connection state, is to send something and get an error if the connection has been closed.

Your code should always be ready to handle unexpected disconnections and other network errors and reconnect if needed.

See also:     OnSend    

Discuss this help topic in SecureBlackbox Forum