property State: TSocketState;
State defines the current state of the socket, mainly used for log or display purposes.. The following values are available:
Server sockets usually follow path: wsClosed -> wsBound -> wsListening -> wsClosed.
Client sockets usually follow path: wsClosed -> wsOpened -> wsConnecting -> wsConnected -> wsClosed.
The State property is intended for display or logging purpose only. To manage your application flow/state, use the events instead. The most usefull events are OnSessionConnected, OnSessionAvailable, OnSessionClosed and OnDataAvailable.