CVS update: JGroups/src/org/jgroups/client StompConnection.java

"Bela Ban" <[email protected]> Mon, 1 Nov 2010 07:50:13 +0000
Newsgroups gmane.comp.java.javagroups.cvs
Message-ID <[email protected]>
  User: belaban 
  Date: 10/11/01 07:50:13

  Modified:    src/org/jgroups/client Tag: Branch_JGroups_2_10
                        StompConnection.java
  Log:
  backported StompChat and StompDraw from head
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.9.4.3   +9 -2      JGroups/src/org/jgroups/client/StompConnection.java
  
  Index: StompConnection.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/client/StompConnection.java,v
  retrieving revision 1.9.4.2
  retrieving revision 1.9.4.3
  diff -u -r1.9.4.2 -r1.9.4.3
  --- StompConnection.java	30 Oct 2010 10:13:12 -0000	1.9.4.2
  +++ StompConnection.java	1 Nov 2010 07:50:13 -0000	1.9.4.3
  @@ -27,7 +27,7 @@
    * <p/>
    * [1] http://stomp.codehaus.org/Protocol
    * @author Bela Ban
  - * @version $Id: StompConnection.java,v 1.9.4.2 2010/10/30 10:13:12 belaban Exp $
  + * @version $Id: StompConnection.java,v 1.9.4.3 2010/11/01 07:50:13 belaban Exp $
    */
   @Experimental @Unsupported
   public class StompConnection implements Runnable {
  @@ -179,7 +179,7 @@
           if(destination != null)
               sb.append("destination: ").append(destination).append("\n");
           if(buf != null)
  -            sb.append("content-length: ").append(length +1).append("\n"); // the 1 additional byte is the NULL_BYTE
  +            sb.append("content-length: ").append(length).append("\n");
           if(headers != null && headers.length % 2 == 0) { // must be even
               for(int i=0; i < headers.length; i++)
                   sb.append(headers[i]).append(": ").append(headers[++i]).append("\n");
  @@ -198,6 +198,13 @@
           }
       }
   
  +    /**
  +     * Sends an INFO without body
  +     */
  +    public void send(String destination, String ... headers) {
  +        send(destination, null, 0, 0, headers);
  +    }
  +
       public void send(String destination, byte[] buf, int offset, int length) {
           send(destination, buf, offset, length, (String[])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