コード例 #1
0
ファイル: GestureServer.cs プロジェクト: ushadow/handinput
 void OnClientConnected(object sender, ClientConnectedEventArgs e)
 {
     connection = e.Client;
 }
コード例 #2
0
 void ClientDisconnected(WebSocketConnection sender, EventArgs e)
 {
     Connections.Remove(sender);
     //LogLine(DateTime.Now + "> " + sender.ConnectionSocket.LocalEndPoint + " disconnected", ServerLogLevel.Subtle);
 }
コード例 #3
0
 void DataReceivedFromClient(WebSocketConnection sender, DataReceivedEventArgs e)
 {
     /*Log(DateTime.Now + "> data from " + sender.ConnectionSocket.LocalEndPoint, ServerLogLevel.Subtle);
      * Log(": " + e.Data + "\n" + e.Size + " bytes", ServerLogLevel.Verbose);
      * LogLine("", ServerLogLevel.Subtle);*/
 }
コード例 #4
0
 public ClientConnectedEventArgs(WebSocketConnection client)
 {
     Client = client;
 }
コード例 #5
0
 private void OnClientDisconnect(WebSocketConnection sender, EventArgs e)
 {
     Console.WriteLine("Client disconnected.");
 }
コード例 #6
0
 public ClientConnectedEventArgs(WebSocketConnection client)
 {
     Client = client;
 }
コード例 #7
0
 private void OnClientDisconnect(WebSocketConnection sender, EventArgs e)
 {
     Console.WriteLine("Client disconnected.");
 }
コード例 #8
0
        private void OnClientConnect(IAsyncResult asyn)
        {
            try {
            var client = tcpListener.EndAcceptTcpClient(asyn);
            Log.InfoFormat("New connection from {0}", client.Client.RemoteEndPoint);
            ShakeHands(client);

            var clientConnection = new WebSocketConnection(client.Client);
            clientConnection.Disconnected += new WebSocketDisconnectedEventHandler(OnClientDisconnect);
            if (ClientConnected != null)
              ClientConnected(this, new ClientConnectedEventArgs(clientConnection));
            ListenForClients();
              } catch (ObjectDisposedException ode) {
            Log.Info(ode.Message);
              }
        }