Example #1
0
 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);
 }
Example #2
0
 public void AddMessageDelegate(ServerMessageDelegate del)
 {
     messageDelegates.Add(del);
 }
Example #3
0
 public void RemoveMessageDelegate(ServerMessageDelegate del)
 {
     messageDelegates.Remove(del);
 }
Example #4
0
 public TCPClient(Control control, ConnectDelegate connectDelegate, DisconnectDelegate disconnectDelegate, ServerMessageDelegate messageDelegate)
 {
     this.control            = control;
     this.connectDelegate    = connectDelegate;
     this.disconnectDelegate = disconnectDelegate;
     AddMessageDelegate(messageDelegate);
 }