On_sock_event Event

Top  Previous  Next

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 sock.state and sock.statesimple R/O properties that return current socket state). The newstate argument uses the same set of constants as the sock.state.  The newstatesimple argument uses the same set of constants as the sock.statesimple. See sock.state and sock.statesimple for detailed description of reported socket states.

Newstate and Newstatesimple arguments of the on_sock_event have been introduced in the Tibbo BASIC/C release 2.0. They replace sock.event and sock.eventsimple R/O properties which are no longer available.