Пример #1
0
 void DataReceivedFromClient(WebSocketConnection sender, DataReceivedEventArgs e)
 {
     Console.WriteLine("WebSocketServer(): " + DateTime.Now + "> data from " + sender.ConnectionSocket.LocalEndPoint);
     Console.WriteLine("WebSocketServer(): " + e.Data + "\n" + e.Size + " bytes");
 }
Пример #2
0
 static void OnClientConnected(WebSocketConnection sender, EventArgs e)
 {
     sender.Disconnected += new WebSocketConnection.WebSocketDisconnectedEventHandler(OnClientDisconnected);
     sender.DataReceived += new WebSocketConnection.DataReceivedEventHandler(OnClientMessage);
     Console.WriteLine("Main(): A Client connected!");
 }
Пример #3
0
 void ClientDisconnected(WebSocketConnection sender, EventArgs e)
 {
     Connections.Remove(sender);
 }