Ejemplo n.º 1
0
        static Ampm()
        {
            _SocketToServer = new SocketIOClient.Client("http://localhost:3001");
            _SocketToServer.Opened += Socket_Opened;
            _SocketToServer.Connect();
            _SocketToServer.SocketConnectionClosed += (sender, e) => _SocketToServer.Connect();
            _SocketToServer.Error += (sender, e) => _SocketToServer.Connect();

            // Handle incoming OSC messages.
            _OscReceive.MessageReceived += Server_MessageReceived;
            _OscReceive.Start();
        }
Ejemplo n.º 2
0
        static Ampm()
        {
            _SocketToServer         = new SocketIOClient.Client("http://localhost:3001");
            _SocketToServer.Opened += Socket_Opened;
            _SocketToServer.Connect();
            _SocketToServer.SocketConnectionClosed += (sender, e) => _SocketToServer.Connect();
            _SocketToServer.Error += (sender, e) => _SocketToServer.Connect();

            // Handle incoming OSC messages.
            _OscReceive.MessageReceived += Server_MessageReceived;
            _OscReceive.Start();
        }
Ejemplo n.º 3
0
 private void DoConnect()
 {
     if (null != m_WebSocket && m_WebSocket.IsConnected)
     {
         m_WebSocket.Close();
     }
     m_WebSocket         = new SocketIOClient.Client(m_Url);
     m_WebSocket.Opened += OnOpened;
     m_WebSocket.Error  += OnError;
     m_WebSocket.SocketConnectionClosed += OnClosed;
     m_WebSocket.Message += OnMessageReceived;
     m_WebSocket.Connect();
 }
Ejemplo n.º 4
0
        private void ConnectIfNotOpen()
        {
            if (!IsConnected)
            {
                m_IsLogged        = false;
                m_LastConnectTime = TimeUtility.GetLocalMilliseconds();
                GfxSystem.GfxLog("ConnectIfNotOpen at time {0}", m_LastConnectTime);

                m_WebSocket         = new SocketIOClient.Client(m_Url);
                m_WebSocket.Opened += OnOpened;
                m_WebSocket.Error  += OnError;
                m_WebSocket.SocketConnectionClosed += OnClosed;
                m_WebSocket.Message += OnMessageReceived;
                m_WebSocket.Connect();
            }
        }
Ejemplo n.º 5
0
        private void ConnectToNodeJsServer(object state)
        {
            try
            {
                socket         = new SocketIOClient.Client(str_url_nodejs);
                socket.Opened += SocketOpened;
                socket.Connect();
                socket.Connect("/canal1");

                socket.Emit("login", "{\"name\":\"simpletest\",\"groupe\":\"simpletest\"}", "/canal1");
                socket.Emit("join", "simpletest", "/canal1");
            }
            catch (SystemException error)
            {
                Log.Error(error.ToString());
            }
        }
Ejemplo n.º 6
0
        public static void Main(string[] argsx)
        {
            var socket = new SocketIOClient.Client("https://whatsplus.herokuapp.com/");

            socket.On("connect", (fn) => {
                Console.WriteLine("connect - socket");

                socket.On("message", (data) => {
                    Console.WriteLine(data.MessageText);
                });
                Dictionary <string, string> args = new Dictionary <string, string>();
                args.Add("data", "What's up+?!!");
                socket.Emit("my_broadcast_event", args);
            });

            socket.Error += (sender, e) => {
                Debug.WriteLine("socket Error: " + e.Message.ToString());
            };
            socket.Connect();
            Console.ReadLine();
        }
Ejemplo n.º 7
0
 public SailsSocket(SocketIOClient.Client socket)
 {
     this.socket     = socket;
     socket.Message += socket_Message;
 }
Ejemplo n.º 8
0
 public MemberEntryFrom(SocketIOClient.Client websocket)
 {
     InitializeComponent();
     this.websocket = websocket;
 }