2012-09-10 00:36:22 +08:00
|
|
|
using System;
|
|
|
|
using WebSocketSharp;
|
|
|
|
using WebSocketSharp.Server;
|
|
|
|
|
2013-09-13 15:54:41 +08:00
|
|
|
namespace Example3
|
|
|
|
{
|
2014-09-06 16:50:10 +08:00
|
|
|
public class Echo : WebSocketBehavior
|
2012-09-10 00:36:22 +08:00
|
|
|
{
|
2013-09-13 15:54:41 +08:00
|
|
|
protected override void OnMessage (MessageEventArgs e)
|
2012-09-10 00:36:22 +08:00
|
|
|
{
|
2014-10-04 13:50:11 +08:00
|
|
|
var name = Context.QueryString["name"];
|
2015-11-28 14:52:44 +08:00
|
|
|
Send (!name.IsNullOrEmpty () ? String.Format ("\"{0}\" to {1}", e.Data, name) : e.Data);
|
2012-09-10 00:36:22 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|