예제 #1
0
    void OnFileAdded(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
    {
        string pathInCamfi = args[0].ToString();
        //Debug.Log("拍照成功,其Url: " + pathInCamfi);
        HTTPRequest request = new HTTPRequest(new Uri(CamfiServerInfo.CamFiGetRawDataByEnCodeUrlStr(UrlEncode(pathInCamfi))), HTTPMethods.Get, GetRawDataFinished);

        request.Send();
    }
 void OnConnected(BestHTTP.SocketIO.Socket socket, BestHTTP.SocketIO.Packet packet, object[] args)
 {
     IsConnected = true;
     if (Connected != null)
     {
         Connected(this, null);
     }
 }
예제 #3
0
 private void OnConnected(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     if (PlayerPrefs.HasKey("Nick"))
     {
         this.Nick = PlayerPrefs.GetString("Nick", "NickName");
         this.Join();
     }
     else
     {
         this.State = States.WaitForNick;
     }
     this.AddMessage("connected");
 }
예제 #4
0
 private void OnFrame(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     if (this.State == States.Joined)
     {
         if (this.FrameTexture == null)
         {
             this.FrameTexture = new Texture2D(0, 0, TextureFormat.RGBA32, false);
             this.FrameTexture.filterMode = FilterMode.Point;
         }
         byte[] data = packet.Attachments[0];
         this.FrameTexture.LoadImage(data);
     }
 }
예제 #5
0
파일: Socket.cs 프로젝트: ubberkid/PeerATT
        /// <summary>
        /// Called when a "connect" event received to the root namespace
        /// </summary>
        private void OnTransportOpen(Socket socket, Packet packet, params object[] args)
        {
            // If this is not the root namespace, then we send a connect message to the server
            if (this.Namespace != "/")
                (Manager as IManager).SendPacket(new Packet(TransportEventTypes.Message, SocketIOEventTypes.Connect, this.Namespace, string.Empty));

            // and we are no open
            IsOpen = true;
        }
예제 #6
0
 public EventTable(BestHTTP.SocketIO.Socket socket)
 {
     this.Socket = socket;
 }
예제 #7
0
 void OnLiveshowData(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     //print(packet.AttachmentCount);
 }
예제 #8
0
 void OnLiveshowError(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     Debug.LogWarning("实时取景发送错误");
 }
예제 #9
0
 void OnCameraRemove(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     Debug.LogWarning("CamFi丢失相机连接");
     _connectCameraSuccess = false;
     _onBreakCameraAction.Invoke();
 }
예제 #10
0
 private void OnConnections(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     this.connections = Convert.ToInt32(args[0]);
 }
예제 #11
0
 void OnDisConnected(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     Debug.LogWarning("与CamFi的SokectIO连接 断开");
     _connectCamfiSuccess = false;
     _onBreakCamfiAction.Invoke();
 }
예제 #12
0
 void OnConnected(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     Debug.LogWarning("与CamFi的SokectIO连接建立");
     _connectCamfiSuccess = true;
     _onConnectCamfiAction.Invoke();
 }
예제 #13
0
        /// <summary>
        /// Internal function to remove a Socket instance from this manager.
        /// </summary>
        /// <param name="socket"></param>
        void IManager.Remove(Socket socket)
        {
            Namespaces.Remove(socket.Namespace);
            Sockets.Remove(socket);

            if (Sockets.Count == 0)
                Close();
        }
예제 #14
0
        /// <summary>
        /// Returns with the specified namespace
        /// </summary>
        public Socket GetSocket(string nsp)
        {
            if (string.IsNullOrEmpty(nsp))
                throw new ArgumentNullException("Namespace parameter is null or empty!");

            /*if (nsp[0] != '/')
                nsp = "/" + nsp;*/

            Socket socket = null;
            if (!Namespaces.TryGetValue(nsp, out socket))
            {
                // No socket found, create one
                socket = new Socket(nsp, this);

                Namespaces.Add(nsp, socket);
                Sockets.Add(socket);

                (socket as ISocket).Open();
            }

            return socket;
        }
예제 #15
0
 private void OnError(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     this.AddMessage($"--ERROR - {args[0].ToString()}");
 }
예제 #16
0
 void OnCameraAdd(BestHTTP.SocketIO.Socket socket, Packet packet, params object[] args)
 {
     Debug.LogWarning("CamFi连接了相机");
     _connectCameraSuccess = true;
     _onConnectCameraAction.Invoke();
 }
 void OnConnected(BestHTTP.SocketIO.Socket socket, BestHTTP.SocketIO.Packet packet, object[] args)
 {
     Debug.Log("Connected to socket server");
 }
 /// <summary>
 /// Internal function to remove a Socket instance from this manager.
 /// </summary>
 /// <param name="socket"></param>
 void IManager.Remove(Socket socket)
 {
     Namespaces.Remove(socket.Namespace);
     Sockets.Remove(socket);
 }