GPRSClient / Java server closes port after sending

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(); } }

Reply to
Mark
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.