Difference between revisions of "TWSocket.State"

From Overbyte
Jump to navigation Jump to search
(Created page with '== Definition == '''property''' State: '''TSocketState'''; == Descripton == '''State''' defines the state of the socket. The following values are available: * wsInvalidState…')
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Main_Page | Main page]] -> [[ICS_Components_Reference | ICS component reference]] -> [[TWSocket]] -> [[TWSocket.State | State]]
 +
 
== Definition ==
 
== Definition ==
  
Line 5: Line 7:
 
== Descripton ==
 
== Descripton ==
  
'''State''' defines the state of the socket. The following values are available:
+
'''State''' defines the current state of the socket, mainly used for log or display purposes.. The following values are available:
 
 
* wsInvalidState
 
  
 
* wsInvalidState
 
* wsInvalidState
Line 18: Line 18:
 
* wsListening
 
* wsListening
 
* wsClosed
 
* wsClosed
 +
 +
Server sockets usually follow path: wsClosed -> wsBound -> wsListening -> wsClosed.
 +
 +
Client sockets usually follow path: wsClosed -> wsOpened -> wsConnecting -> wsConnected -> wsClosed.
 +
 +
== Best practices ==
 +
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  [[TWSocket.OnSessionConnected | OnSessionConnected]], [[TWSocket.OnSessionAvailable | OnSessionAvailable]], [[TWSocket.OnSessionClosed | OnSessionClosed]] and [[TWSocket.OnDataAvailable | OnDataAvailable]].

Latest revision as of 11:58, 30 December 2015

Main page -> ICS component reference -> TWSocket -> State

Definition

property State: TSocketState;

Descripton

State defines the current state of the socket, mainly used for log or display purposes.. The following values are available:

  • wsInvalidState
  • wsOpened
  • wsBound
  • wsConnecting
  • wsSocksConnected
  • wsConnected
  • wsAccepting
  • wsListening
  • wsClosed

Server sockets usually follow path: wsClosed -> wsBound -> wsListening -> wsClosed.

Client sockets usually follow path: wsClosed -> wsOpened -> wsConnecting -> wsConnected -> wsClosed.

Best practices

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.