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
<?php // 7.3.0-dev | |
$clientPort; | |
$clientIP; | |
$address = "127.0.0.1"; | |
$port = 9001; | |
if (($listenSocket = @socket_create(AF_INET, SOCK_STREAM, 0)) === false) exit ("could not create socket"); | |
if ((@socket_set_option($listenSocket, SOL_SOCKET, SO_REUSEADDR, 1)) === false) exit ("could not set the socket to be reusable"); | |
if ((@socket_bind($listenSocket, $address, $port)) === false) exit ("could not bind the socket to the address:port provided"); | |
if ((@socket_listen ($listenSocket)) === false) exit ("could not listen to socket"); | |
if ((@socket_set_nonblock ($listenSocket)) === false) exit("could not set the socket to non-blocking mode"); |