on_sock_event Event

Function:

Notifies your program that the socket state has changed.

Declaration:

on_sock_event(newstate as pl_sock_state, newstatesimple as pl_sock_state_simple)

See Also:

---


Part

Description

newstate

"Detailed" state of the socket at the time of event generation.

newstatesimple

"Simplified" state of the socket at the time of event generation.


Details

When the event handler for this event is entered, the sock.num property is automatically switched to the socket for which this event was generated. Another on_sock_event event on a particular socket is never generated until the previous one is processed.

The newstate and newstatesimple arguments carry the state as it was at the moment of event generation. This is different from the sock.state and sock.statesimple read-only properties, which return the current socket state. The newstate argument uses the same set of constants as sock.state. The newstatesimple argument uses the same set of constants as sock.statesimple.

The newstate and newstatesimple arguments of on_sock_event were introduced in Tibbo BASIC/C 2.0. They replace the sock.event and sock.eventsimple read-only properties, which are no longer available.


on_sock_event Event

Details