Socket on GPRS

From: Mark (markie_at_gmx.net)
Date: 01/05/04


Date: 5 Jan 2004 08:36:06 -0800

Hi group'rs!

Hi downloaded the KKMultiServer-example from Sun for a multi-user
echo-server.
The good thing is, I managed to flip out the protocol and got the
server working.
The bad thing is dat my GPRS-client gets a **NO CARRIER** after each
reply. So it seems the server closes the connection.

W h y ????
Any help is appreciated much!

Here's some code from the example thread-class:

    public void run()
        {
                try
                {
                        PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
                        BufferedReader in = new BufferedReader(new
InputStreamReader(socket.getInputStream()));

                        String inputLine, outputLine;
                        KnockKnockProtocol kkp = new KnockKnockProtocol();
                        outputLine = kkp.processInput(null);
                        out.println(outputLine);

                        while ((inputLine = in.readLine()) != null)
                        {
                                outputLine = kkp.processInput(inputLine);
                                out.println(outputLine);
                                if (outputLine.equals("Bye")) break;
                        }
                        out.close();
                        in.close();
                        socket.close();

                }
                catch (IOException e)
                {
                        e.printStackTrace();
                }
    }



Relevant Pages