private void StartServer() { try { _server = new LANTalk.Core.Server(); var config = Global.LoadConfig(); _server.StartServer( IPAddress.Parse(config.Rows[0][Global.ASS_STRING].ToString()), int.Parse(config.Rows[0][Global.PORT_STRING].ToString()), SocketAcceptCallback, SocketLostCallback, ListenErrorCallback, ReceiveCallback, SendBefore, null ); } catch (Exception ex) { MessageBox.Show("Start Server Error:" + ex.Message, "Error"); ReturnTitle(); } }
private void Server_Load(object sender, EventArgs e) { Control.CheckForIllegalCrossThreadCalls = false; clbOnlineList.Items.Add("All/None"); var server = new Core.Server(); server.StartServer( _ip, _port, SocketAcceptCallback, SocketLostCallback, ListenErrorCallback, ReceiveCallback, SendBefore, ListenCallback ); }