Removed old Java client, added new experimental PHP client.

This commit is contained in:
Michael Jumper
2010-09-23 09:57:53 +00:00
parent 7bbc9b5ae5
commit 8f3e6a7340
46 changed files with 55 additions and 1625 deletions

View File

@@ -0,0 +1,35 @@
<?php
# End all output buffers
while (@ob_end_flush());
# Create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0);
if (!$socket) {
die("error:Could not create socket.;");
}
# Open connection
$result = socket_connect($socket, "localhost", 2222);
if (!$result) {
die("error:Could not connect: " . socket_strerror(socket_last_error()) . ";");
}
# Socket should block
socket_set_block($socket);
# Write all data sent here
socket_write($socket, file_get_contents("php://input"));
# Read until EOF
while (($buffer = socket_read($socket, 8192))) {
echo $buffer;
flush();
}
echo ";";
# Close socket
socket_close($socket);
?>