websocket-sharp/Example2/Echo.cs

17 lines
368 B
C#
Raw Normal View History

2012-08-06 13:34:39 +08:00
using System;
using WebSocketSharp;
using WebSocketSharp.Server;
namespace Example2
{
public class Echo : WebSocketBehavior
2012-08-06 13:34:39 +08:00
{
protected override void OnMessage (MessageEventArgs e)
{
2014-10-03 14:32:50 +08:00
var name = Context.QueryString["name"];
var msg = !name.IsNullOrEmpty () ? String.Format ("'{0}' to {1}", e.Data, name) : e.Data;
Send (msg);
}
2012-08-06 13:34:39 +08:00
}
}