Beispiel #1
0
        public void OnSocketOpen(SocketInterface socketInterface)
        {
//            Debug.Log("initWebSocket_open " + appId + " ");
            _isSocketOpen = true;
            _socket       = socketInterface;
            RegisterDeviceInPush(false);
            var data = new JSONObject();

            FireOnceEvents("open", data);
        }
Beispiel #2
0
        private void InitWebSocket(string socketServerAddress)
        {
//            Debug.Log("initWebSocket " + socketServerAddress + appId + " ");

            _socket = new WebSocketHandler(socketServerAddress, _stateMachine);

            ((WebSocketHandler)_socket).InitWebSocket(socketServerAddress, this, _stateMachine,

                                                      // onMessage
                                                      delegate(JSONObject message) { OnSocketMessage(message); },

                                                      // onOpen
                                                      delegate(SocketInterface socketInterface) { OnSocketOpen(socketInterface); },

                                                      // onClose
                                                      delegate(int errorCode) { OnSocketClose(errorCode); });
        }
 public void OnOpen(SocketInterface webSocket)
 {
     _onOpen(webSocket);
 }