Exemplo n.º 1
0
 public void Receive()
 {
     if (client.Connected)
     {
         ClientState state = new ClientState();
         state.InitData(1024);
         client.BeginReceive(state.Data, state.usered, state.remaining, 0, ReceiveCallback, state);
     }
 }
Exemplo n.º 2
0
 public void Send(String msg)
 {
     Byte[] data = encoding.GetBytes(msg);
     ClientState state = new ClientState();
     state.InitData(data);
     client.BeginSend(data, 0, data.Length, 0, SendCallback, state);
 }
Exemplo n.º 3
0
 private void Send(ClientState state)
 {
     if (client.Connected)
     {
         client.BeginSend(state.Data, state.usered, state.remaining, 0, SendCallback, state);
     }
 }