websocket-sharp/Example2/Program.cs

26 lines
618 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-09-17 17:41:08 +08:00
var wssv = new WebSocketServer<Echo>("ws://localhost:4649");
2012-08-06 13:34:39 +08:00
//var wssv = new WebSocketServer<Chat>("ws://localhost:4649");
2012-09-17 17:41:08 +08:00
//var wssv = new WebSocketServer<Echo>(4649);
2012-08-04 14:51:31 +08:00
wssv.Start();
Console.WriteLine(
2012-09-01 16:01:05 +08:00
"WebSocket Server (url: {0})\n listening on address: {1} port: {2}\n",
wssv.Uri, wssv.Address, wssv.Port);
2012-08-04 14:51:31 +08:00
Console.WriteLine("Press any key to stop server...");
Console.ReadLine();
wssv.Stop();
}
}
}