You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
397 B

12 years ago
  1. using System;
  2. using WebSocketSharp;
  3. using WebSocketSharp.Server;
  4. namespace Example3
  5. {
  6. public class Echo : WebSocketService
  7. {
  8. protected override void OnMessage (MessageEventArgs e)
  9. {
  10. var name = Context.QueryString ["name"];
  11. var msg = !name.IsNullOrEmpty ()
  12. ? String.Format ("'{0}' to {1}", e.Data, name)
  13. : e.Data;
  14. Send (msg);
  15. }
  16. }
  17. }