Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
RTCQueue standalone library
namespace Library;
class RTCQueue {
public static function Send($channel, $data) {
$data = array("channel"=>$channel, "data"=>$data);
$address = "";
$port = "8899";
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($socket, $address, $port);
$json = json_encode($data, false)."\r\n";
socket_write($socket, $json);
socket_shutdown ($socket, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment