forked from neil3d/UnityRemoteLog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
52 lines (43 loc) · 1.41 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using SuperSocket.SocketBase;
using SuperSocket.SocketBase.Config;
using System;
using System.Windows.Forms;
namespace URLogWin
{
static class Program
{
static AppServer appServer;
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//-- 启动一个服务器
appServer = new AppServer();
var serverConfig = new ServerConfig
{
Port = 2010, //set the listening port
TextEncoding = "UTF-8",
};
//Setup the appServer
if (!appServer.Setup(serverConfig))
{
System.Diagnostics.Debug.Write("创建App Server失败");
}
//Try to start the appServer
if (!appServer.Start())
{
System.Diagnostics.Debug.Write("启动App Server失败");
}
var mainFrm = new MainForm();
appServer.NewSessionConnected += mainFrm.appServerNewSessionConnected;
appServer.SessionClosed += mainFrm.appServerSessionClosed;
Application.Run(mainFrm);
//Stop the appServer
appServer.Stop();
}
}
}