static void Main(string[] args) { ServerPeer server = new ServerPeer(); server.SetApplication(new NetMsgCenter()); server.StartServer("127.0.0.1", 6666, 10); Console.ReadKey(); }
public void OnStartServer() { ServerPeer serverPeer = new ServerPeer(); IApplicationBase app = new NetMessageCenter(); serverPeer.SetApplication(app); serverPeer.StartServer(6666, 10); Console.WriteLine("开启服务器成功~~"); }
static void Main(string[] args) { ServerPeer server = new ServerPeer(); server.SetApplication(new NetMsgCenter()); server.StartServer("172.26.228.2", 6666, 100); Database.DatabaseManager.StartConnect(); Console.ReadKey(); }
public static void Main(string[] args) { ServerPeer server = new ServerPeer(); server.SetApplicationLayer(new NetMsgCenter()); server.StartServer("127.0.0.1", 6666, 10); //阻塞主线程,防止退出 Console.ReadLine(); }
static void Main(string[] args) { ServerPeer server = new ServerPeer(); server.SetApplication(new NetMsgCenter()); // 设置应用层 server.StartServer("127.0.0.1", 6666, 100); Database.DatabaseManager.StartConnection(); // 连接数据库 Console.ReadKey(); }