websocket-sharp/Example2/Program.cs

25 lines
536 B
C#
Raw Normal View History

2012-08-04 14:51:31 +08:00
using System;
2012-08-06 13:34:39 +08:00
using WebSocketSharp.Server;
2012-08-04 14:51:31 +08:00
2012-08-06 13:34:39 +08:00
namespace Example2
2012-08-04 14:51:31 +08:00
{
public class Program
{
2012-08-06 13:34:39 +08:00
public static void Main(string[] args)
2012-08-04 14:51:31 +08:00
{
2012-08-06 13:34:39 +08:00
var wssv = new WebSocketServer<Echo>("ws://localhost:4649");
//var wssv = new WebSocketServer<Chat>("ws://localhost:4649");
2012-08-04 14:51:31 +08:00
wssv.Start();
Console.WriteLine(
2012-08-18 01:17:12 +08:00
"WebSocket Server (url: {0}) listening on port: {1}\n",
wssv.Url, wssv.Port);
2012-08-04 14:51:31 +08:00
Console.WriteLine("Press any key to stop server...");
Console.ReadLine();
wssv.Stop();
}
}
}