CVS update: JGroups/src/org/jgroups/protocols STOMP.java

"Bela Ban" <[email protected]> Thu, 21 Oct 2010 13:29:22 +0000
Newsgroups gmane.comp.java.javagroups.cvs
Message-ID <[email protected]>
  User: belaban 
  Date: 10/10/21 13:29:22

  Modified:    src/org/jgroups/protocols STOMP.java
  Log:
  ns
  
  Revision  Changes    Path
  1.3       +10 -3     JGroups/src/org/jgroups/protocols/STOMP.java
  
  Index: STOMP.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/STOMP.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- STOMP.java	21 Oct 2010 13:12:25 -0000	1.2
  +++ STOMP.java	21 Oct 2010 13:29:22 -0000	1.3
  @@ -21,7 +21,7 @@
    * Protocol which provides STOMP support. Very simple implementation, with a 1 thread / connection model. Use for
    * a few hundred clients max.
    * @author Bela Ban
  - * @version $Id: STOMP.java,v 1.2 2010/10/21 13:12:25 belaban Exp $
  + * @version $Id: STOMP.java,v 1.3 2010/10/21 13:29:22 belaban Exp $
    * @since 2.11
    */
   @MBean
  @@ -144,11 +144,16 @@
               while(!sock.isClosed()) {
                   try {
                       Frame frame=readFrame(in);
  -                    System.out.println("frame = " + frame);
  +                    if(frame != null) {
  +                        System.out.println("frame = " + frame);
  +                    }
  +                }
  +                catch(EOFException eof_ex) {
  +                    stop();
                   }
                   catch(IOException ex) {
                       log.error("failure reading frame", ex);
  -                    stop(); // ??
  +                    stop();
                   }
   
               }
  @@ -158,6 +163,8 @@
               String verb=Util.readLine(in);
               if(verb == null)
                   throw new EOFException("reading verb");
  +            if(verb.length() == 0)
  +                return null;
   
               Map<String,String> headers=new HashMap<String,String>();
               byte[] body=null;
  
  
  

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev