allright this is my server code:
ServerSocket serverSocket = new ServerSocket(27016);
while (true) {
Socket clientSocket = serverSocket.accept();
BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(clientSocket.getOutputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine);
}
out.write("hello client!");
out.flush();
}
client code:
$fp = fsockopen("67.184.204.230", 27016, $errno, $errstr, 5);
if (!$fp) {
echo "$errstr ($errno)";
} else {
fwrite($fp, "hello server\r\n"); // send data to server
echo fread($fp, 200); // @@@@ read output from the server
fclose($fp);
}
the problem is that I get no output from the server at all, the client script runs for about 10 seconds and then apparently it times out and all i get is a "white" empty page, but the weird thing is that the server DOES get my "hello server" message...
so what could be the problem? Believe me i made hundreds of google queries and apparently no one has ever tried this in the history of the internet.
please help?