Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

php client --> java server

843790Apr 2 2010 — edited Apr 6 2010
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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 4 2010
Added on Apr 2 2010
3 comments
206 views