mcky Posted July 18, 2008 Share Posted July 18, 2008 Basically I'm trying to create a socket to listen to a TF2 server's logs, but I lack any decent PHP skills. This is all I have so far: <?php $socket = stream_socket_server('udp://250.250.250.250:6789', $errno, $errstr, STREAM_SERVER_BIND); $data = stream_socket_recvfrom($socket, 4096); echo "Data: ".$data; fclose($socket); ?> It does receive the incoming data but it dies straight after the first line is received. I'm guessing some sort of loop is required (as the incoming data is consistent), but I have no idea where to start. Any help would be appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/115397-listening-socket/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.