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.

16 lines
368 B

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