Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$address = "unix://\0testtest";
$socket = stream_socket_server($address, $errorCode, $errorMessage);
if (!$socket) {
throw new Exception('Failed Socket Server');
}
while ($conn = stream_socket_accept($socket, 65535)) {
print("@receive");
fwrite($conn, 'Server Message' . "\n");
fclose($conn);
}
fclose($socket);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment