Exemple #1
0
	private static void OnMessageReceived(object sender,MessageReceivedEventArgs e)
	{
		var client = (WebSocketClient)sender;
		Console.WriteLine("Received by [{0}]",((IPEndPoint)client.Socket.RemoteEndPoint).ToString());

		var received_msg = Encoding.UTF8.GetString(e.DecodedMessage);
		Console.WriteLine("Received message: {0}",received_msg);
		
		var msg = new WebSocketMessage();
		msg.Append(received_msg);

		client.SendMessage(msg);
	}