示例#1
0
 /// <summary>
 /// Send data to all connected clients excepts sender.
 /// </summary>
 /// <param name="bytes">The byte array to be send.</param>
 /// <param name="offset">The position in the data buffer at witch to begin sending.</param>
 /// <param name="length">The number of the bytes to be send.</param>
 /// <param name="sender">The TCP client exception.</param>
 public void ReplyToAllExceptSender(byte[] bytes, int offset, int length, TCPClientConnection sender)
 {
     if (sender != null)
     {
         foreach (DictionaryEntry entry in fConnectedClients)
         {
             try
             {
                 TCPClientConnection tmp = (TCPClientConnection)entry.Value;
                 if (tmp.IPAddress != sender.IPAddress)
                 {
                     tmp.SendData(bytes, offset, length);
                 }
             }
             catch (Exception ex)
             {
             }
         }
     }
 }
示例#2
0
 /// <summary>
 /// Send data to all connected clients excepts sender.
 /// </summary>
 /// <param name="data">The string to be send.</param>
 /// <param name="sender">The TCP client exception.</param>
 public void ReplyToAllExceptSender(string data, TCPClientConnection sender)
 {
     if (sender != null)
     {
         foreach (DictionaryEntry entry in fConnectedClients)
         {
             try
             {
                 TCPClientConnection tmp = (TCPClientConnection)entry.Value;
                 if (tmp.IPAddress != sender.IPAddress)
                 {
                     tmp.SendData(data);
                 }
             }
             catch (Exception ex)
             {
             }
         }
     }
 }
示例#3
0
 /// <summary>
 /// Send data to a client.
 /// </summary>
 /// <param name="bytes">The byte array to be send.</param>
 /// <param name="offset">The position in the data buffer at witch to begin sending.</param>
 /// <param name="length">The number of the bytes to be send.</param>
 /// <param name="sender">The client to send the data.</param>
 public virtual void ReplyToSender(byte[] bytes, int offset, int length, TCPClientConnection sender)
 {
     sender.SendData(bytes, offset, length);
 }
示例#4
0
 /// <summary>
 /// Send data to a client.
 /// </summary>
 /// <param name="data">The string to send.</param>
 /// <param name="sender">The client to send the data.</param>
 public virtual void ReplyToSender(string data, TCPClientConnection sender)
 {
     sender.SendData(data);
 }