My Script:
Code: Select all
#!C:\php\php.exe -q
<?php
//we will create a socket, set options, bind, and listen
//accept client connection, accept input, parse it, write it to client
//close client, close master
$master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($master, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind($master, 'localhost', 1234);
socket_listen($master, 5);
$client = socket_accept($master);
$input = socket_read($client, 1024);
$output = strrev($input) . chr(0);
socket_write($client, $output);
unset($output);
socket_shutdown($client, 2);
socket_close($client);
socket_shutdown($master, 2);
socket_close($master);Where is "ýûýûûûû" coming from (must be cached or in buffer somewhere?) or why is my client sending it?
I am running the server as a shell script and using PuTTY as the telnet client.