Created
August 12, 2012 01:47
-
-
Save payden/3328764 to your computer and use it in GitHub Desktop.
PHP WebSocket extension based on libwebsock.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How I want my websocket PHP extension to work: | |
(Something like this) | |
<?php | |
set_time_limit(0); //maybe do this inside extension, if possible? | |
$ws = new WebSocket("3333"); | |
$ws->set_receive_callback(function($state, $msg) { | |
WebSocket::sendText($state->sockfd, $msg->text); | |
}); | |
$ws->set_connect_callback(function($state) { | |
WebSocket::sendText($state->sockfd, "Hello there!"); | |
}); | |
$ws->run(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment