Getting current TCP state of the designated websocket TCP session
int ws_state(int $tcp_id)
integer number indicating TCP session state (TCP_CLOSED, TCP_CONNECTED or TCP_LISTEN)
<?php
include "/lib/sn_tcp_ws.php";
// configuring a websocket and waiting for a connection
ws_setup(0, "my_path", "my_proto");
while(ws_state(0) != TCP_CONNECTED)
;
echo "Web Socket connected!\r\n";
?>