Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- out = new PrintWriter(clientSocket.getOutputStream(), true);
- in = new BufferedReader(
- new InputStreamReader(
- clientSocket.getInputStream()));
- } catch (IOException e) {
- System.err.println("Couldn't get I/O.");
- System.exit(1);
- }
- while (running) {
- try {
- outputLine=getOutput(in);
- } catch(SocketTimeoutException ex){
- outputLine="502 TIMEOUT";
- stop();
- } catch (IOException ex) {
- System.err.println("Couldn't get I/O.");
- }
- if(outputLine.equals("break")){
- stop();
- }else{
- out.print(outputLine + "\r\n");
- out.flush();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement