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.

25 lines
618 B

  1. using System;
  2. using WebSocketSharp.Server;
  3. namespace Example2
  4. {
  5. public class Program
  6. {
  7. public static void Main(string[] args)
  8. {
  9. var wssv = new WebSocketServer<Echo>("ws://localhost:4649");
  10. //var wssv = new WebSocketServer<Chat>("ws://localhost:4649");
  11. //var wssv = new WebSocketServer<Echo>(4649);
  12. wssv.Start();
  13. Console.WriteLine(
  14. "WebSocket Server (url: {0})\n listening on address: {1} port: {2}\n",
  15. wssv.Uri, wssv.Address, wssv.Port);
  16. Console.WriteLine("Press any key to stop server...");
  17. Console.ReadLine();
  18. wssv.Stop();
  19. }
  20. }
  21. }