/// <summary> /// 窗口加载函数 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Form1_Load(object sender, EventArgs e) { /// 通信套接字 _ssm = new SocketServerManager(serverIPString, serverPort); /// 设置回调函数 _ssm.OnReceiveCompletedEvent += this.OnReceiveCompleted; _ssm.OnConnectedEvent += this.OnConnectCompleted; /// 启动监听 _ssm.Start(); /// 设置服务器相关状态 lbl_ServerIP.Text += serverIPString; lbl_Port.Text += serverPort.ToString(); lbl_ServerStatus.Text += ServerStatus.Start; }
public DispatchMessage(ref MessageFormat msg, ref SocketServerManager ssm) { m_MessageFormart = msg; m_IPString = m_MessageFormart.ipStr; m_SocketManager = ssm; }