Browse Source

Fix a few for Example3

pull/168/head
sta 11 years ago
parent
commit
0cb2335b48
  1. 5
      Example3/Chat.cs
  2. 4
      Example3/Echo.cs
  3. 4
      Example3/Program.cs

5
Example3/Chat.cs

@ -19,12 +19,13 @@ namespace Example3
public Chat (string prefix) public Chat (string prefix)
{ {
_prefix = prefix ?? "anon#";
_prefix = !prefix.IsNullOrEmpty () ? prefix : "anon#";
} }
private string getName () private string getName ()
{ {
return Context.QueryString ["name"] ?? (_prefix + getNum ());
var name = Context.QueryString ["name"];
return !name.IsNullOrEmpty () ? name : (_prefix + getNum ());
} }
private static int getNum () private static int getNum ()

4
Example3/Echo.cs

@ -10,8 +10,8 @@ namespace Example3
{ {
var name = Context.QueryString ["name"]; var name = Context.QueryString ["name"];
var msg = !name.IsNullOrEmpty () var msg = !name.IsNullOrEmpty ()
? String.Format ("'{0}' to {1}", e.Data, name)
: e.Data;
? String.Format ("'{0}' to {1}", e.Data, name)
: e.Data;
Send (msg); Send (msg);
} }

4
Example3/Program.cs

@ -16,7 +16,7 @@ namespace Example3
_httpsv = new HttpServer (4649); _httpsv = new HttpServer (4649);
//_httpsv = new HttpServer (4649, true); // For Secure Connection //_httpsv = new HttpServer (4649, true); // For Secure Connection
#if DEBUG #if DEBUG
// Changing logging level
// Changing the logging level
_httpsv.Log.Level = LogLevel.Trace; _httpsv.Log.Level = LogLevel.Trace;
#endif #endif
/* For Secure Connection /* For Secure Connection
@ -39,7 +39,7 @@ namespace Example3
// Not to remove inactive clients in WebSocket services periodically // Not to remove inactive clients in WebSocket services periodically
//_httpsv.KeepClean = false; //_httpsv.KeepClean = false;
// Setting document root path
// Setting the document root path
_httpsv.RootPath = ConfigurationManager.AppSettings ["RootPath"]; _httpsv.RootPath = ConfigurationManager.AppSettings ["RootPath"];
// Setting HTTP method events // Setting HTTP method events

Loading…
Cancel
Save