[Beepcore-java-commits] CVS: beepcore-java/src/org/beepcore/beep/profile/echo EchoProfile.java,1.13,
Status: Beta
Brought to you by:
huston
From: Huston F. <hu...@us...> - 2002-01-23 18:40:33
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/echo In directory usw-pr-cvs1:/tmp/cvs-serv26942/src/org/beepcore/beep/profile/echo Modified Files: EchoProfile.java Log Message: fix bad check-in Index: EchoProfile.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/profile/echo/EchoProfile.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** EchoProfile.java 2002/01/15 16:14:38 1.13 --- EchoProfile.java 2002/01/23 18:40:29 1.14 *************** *** 69,142 **** public void receiveMSG(Message message) throws BEEPError { ! OutputDataStream data = new OutputDataStream(); ! InputDataStream ds = message.getDataStream(); ! while (true) { ! try { ! BufferSegment b = ds.waitForNextSegment(); ! if (b == null) { ! break; } - data.add(b); - } catch (InterruptedException e) { - throw new BEEPError(BEEPError.CODE_REQUESTED_ACTION_ABORTED, - "Error reading request"); } - } ! data.setComplete(); - try { - message.sendRPY(data); - } catch (BEEPException e) { try { ! throw new BEEPError(BEEPError.CODE_REQUESTED_ACTION_ABORTED, "Error sending RPY"); ! } catch (BEEPException x) { ! message.getChannel().getSession().terminate(x.getMessage()); } - return; } } - - // public void receiveMSG(Message message) throws BEEPError - // { - // new ReplyThread(message).start(); - // } - - // private class ReplyThread extends Thread { - // private Message message; - - // ReplyThread(Message message) { - // this.message = message; - // } - - // public void run() { - // OutputDataStream data = new OutputDataStream(); - // InputDataStream ds = message.getDataStream(); - - // while (ds.isComplete() == false || ds.availableSegment()) { - // try { - // data.add(ds.waitForNextSegment()); - // } catch (InterruptedException e) { - // message.getChannel().getSession().terminate(e.getMessage()); - // return; - // } - // } - - // data.setComplete(); - - // try { - // message.sendRPY(data); - // } catch (BEEPException e) { - // try { - // message.sendERR(BEEPError.CODE_REQUESTED_ACTION_ABORTED, - // "Error sending RPY"); - // } catch (BEEPException x) { - // message.getChannel().getSession().terminate(x.getMessage()); - // } - // return; - // } - // } - // } } --- 69,113 ---- public void receiveMSG(Message message) throws BEEPError { ! new ReplyThread(message).start(); ! } ! private class ReplyThread extends Thread { ! private Message message; ! ! ReplyThread(Message message) { ! this.message = message; ! } ! ! public void run() { ! OutputDataStream data = new OutputDataStream(); ! InputDataStream ds = message.getDataStream(); ! ! while (true) { ! try { ! BufferSegment b = ds.waitForNextSegment(); ! if (b == null) { ! break; ! } ! data.add(b); ! } catch (InterruptedException e) { ! message.getChannel().getSession().terminate(e.getMessage()); ! return; } } ! data.setComplete(); try { ! message.sendRPY(data); ! } catch (BEEPException e) { ! try { ! message.sendERR(BEEPError.CODE_REQUESTED_ACTION_ABORTED, "Error sending RPY"); ! } catch (BEEPException x) { ! message.getChannel().getSession().terminate(x.getMessage()); ! } ! return; } } } } |