google-code-export / jwebsocket

Automatically exported from code.google.com/p/jwebsocket
1 stars 3 forks source link

channel cannot dispatch data of complex and number types, except for simple string type. #138

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.For example, client-side code:
   //.......
        var lURL = "ws://localhost:8787/jWebSocket/jWebSocket";
    var gUsername = "guest";
    var lPassword = "guest";

    var lRes = lWSC.logon( lURL, gUsername, lPassword, {
        OnWelcome: function( aEvent )  {
                     lWSC.channelAuth ("publicA", "access", "secret");
                 lWSC.channelSubscribe("publicA", "access");

        },

        OnMessage: function( aEvent, aToken ) {

              var lObj = JSON.parse(aEvent.data);
              console.log (lObj);
                }
       );

   //..............

   var a="hello";
   var b= 12345678;
   var c= {c1:"how",
           c2:"are",
           c3:"you"
          }
   lWSC.channelPublish ("publicA", a);
   lWSC.channelPublish ("publicA", b);
   lWSC.channelPublish ("publicA", c);

What is the expected output?
    The data in a,d,c published should be received and displayed correctly. 

What do you see instead?
    However,only the data a can be received correctly,as below:
          channelId: "publicA"
          data: "hello"
          ns: "org.jwebsocket.plugins.channels"
          publisher: "01.50843.18"
          type: "data"

 while the packets received about the data b and data c both lost the  element 'data', as below:
           channelId: "publicA"
           ns: "org.jwebsocket.plugins.channels"
           publisher: "01.50735.16"
           type: "data"

What version of the product are you using? On what operating system?
      jWebSocket-1.0-nb11024
      windows 7

Please provide any additional information below.
   However, the server-side SystemPlugIn can broadcast all types of data, including simple type and complex.

   So there must be a bug for the server-side channel plugin.

Original issue reported on code.google.com by hehe2...@gmail.com on 1 Nov 2011 at 2:46

GoogleCodeExporter commented 9 years ago
This existed issue can be confirmed in testing by slightly amending the code 
(let it publish a non-string data) of the channel module in the demos shipped 
in the release of jWebSocketClient-1.0.
So please fix this issue as soon as possible.

Original comment by hehe2...@gmail.com on 2 Nov 2011 at 12:52

GoogleCodeExporter commented 9 years ago
Since we currently use a string field for data transmission only we will have 
to extend that to become an object (at least alternatively). Best would be some 
kind of channelPublish Object method here.

Original comment by fivefeetfurther@gmail.com on 14 Apr 2012 at 11:04

GoogleCodeExporter commented 9 years ago
I can't wait this feature any longer.

Could you let me know if this capability you mentioned is available?

Thanks a lot

Original comment by hehe2...@gmail.com on 14 Apr 2012 at 11:30