Beispiel #1
0
 public void Broadcast(byte[] data)
 {
     foreach (var client in _listeners.SelectMany(x => x.ConnectedClients))
     {
         NetworkStreamUtil.Write(client.GetStream(), data);
     }
 }
Beispiel #2
0
 public void Write(byte[] bytes)
 {
     if (m_TcpClient == null)
     {
         throw new Exception("tcpclient is null");
     }
     //m_TcpClient.GetStream().Write(bytes, 0, bytes.Length);
     NetworkStreamUtil.Write(m_TcpClient.GetStream(), bytes);
 }
Beispiel #3
0
 public void Reply(byte[] data)
 {
     NetworkStreamUtil.Write(TcpClient.GetStream(), data);
 }
Beispiel #4
0
 private void Reply(TcpClient client, byte[] msg)
 {
     NetworkStreamUtil.Write(client.GetStream(), PtMessagePackage.Write(PtMessagePackage.Build(messageid, msg)));
     messageid++;
 }