1.
Nach dem Login kopieren
2.
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); $conn = socket_connect($socket, '192.168.1.10', 55660); $buffer = 'test.string'; $len = strlen($buffer); echo 'buffter length: '.$len.' '; $pack = pack('n', $len + 2); $send = socket_write($socket, $pack.$buffer, $len + 2); if($send){ echo 'send ok '; } $read = socket_read($socket, 10240); echo 'read data:'.$read .' '; echo 'read length:'.strlen($read).' '; echo 'real data is:'.substr($read, 2);
3.
sendToClient($recv); //return $this->sendToClient(substr($recv, 2)); } }