Added a new AddWebSocketService method to the WebSocketServer and HttpServer classes

This commit is contained in:
sta
2013-10-02 14:39:56 +09:00
parent 2b57a58da2
commit 24e74b60b7
8 changed files with 356 additions and 64 deletions

View File

@@ -10,10 +10,21 @@ namespace Example2
private static int _num = 0;
private string _name;
private string _prefix;
public Chat ()
: this ("anon#")
{
}
public Chat (string prefix)
{
_prefix = prefix;
}
private string getName ()
{
return Context.QueryString ["name"] ?? ("anon#" + getNum ());
return Context.QueryString ["name"] ?? (_prefix + getNum ());
}
private int getNum ()