static void ConnectCallback(IAsyncResult result) { Send(Message.GetBytes(new Message(MESSAGE_TYPE.REQUEST_LOGIN, Client.login, null))); Logined += new ServerMessageDelegate(Client_Logined); s.BeginReceive(buffer, 0, 1024, SocketFlags.None, RecieveCallback, s); }
public void AddMessageDelegate(ServerMessageDelegate del) { messageDelegates.Add(del); }
public void RemoveMessageDelegate(ServerMessageDelegate del) { messageDelegates.Remove(del); }
public TCPClient(Control control, ConnectDelegate connectDelegate, DisconnectDelegate disconnectDelegate, ServerMessageDelegate messageDelegate) { this.control = control; this.connectDelegate = connectDelegate; this.disconnectDelegate = disconnectDelegate; AddMessageDelegate(messageDelegate); }