Hi Matteo,

In whatever class it makes the most sense in your app, assign a new 
WebSocket-Instance to a member in the constructor. Here a small example, I just 
tested it myself (works :) ). It illustrate you a possible way to go. 

/**
 * @ignore(WebSocket)
 */
qx.Class.define("test.SomeClass",
{
  extend : qx.core.Object,

  construct : function() 
  {
        this.base(arguments);

        this.socket = new WebSocket('ws://localhost:8000/events');

        // native event-listener
        this.socket.addEventListener("message", this.onSocketMessage , false)
  },

  members :
  {
        socket : null,

        onSocketMessage : function(e) {
                console.log(e.data)
        }
  }
});

Best,
Andreas
________________________________________
Von: matteomasina [[email protected]]
Gesendet: Samstag, 7. September 2013 12:52
An: [email protected]
Betreff: Re: [qooxdoo-devel] how to use or integrate socket in qooxdoo

Hi Andreas,

I've posted a sample but for using SimpleIO.js that uses node.js, but I have
already my server code working, developed in c#. So that my problem is
understand hot to integrate in qooxdoo something similar to this :


 /    var ws = new WebSocket("ws://localhost:3500/test");
     ws.onopen = function()
     {
                alert("Connection open");
        // Web Socket is connected, send data using send()
        ws.send("INVIO MESSAGGIO");
        alert("Message is sent...");
     };
     ws.onmessage = function (evt)
     {
        var received_msg = evt.data;
        alert("Message is received...");
     };
     ws.onclose = function()
     {
        // websocket is closed.
        alert("Connection is closed...");
     };/


My server work perfectly with HTML5 ask and answer but how to insert this in
my Qooxdoo Desktop Application ?

Thank you to all for your help

Matteo



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/how-to-use-or-integrate-socket-in-qooxdoo-tp7584526p7584568.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to