/// <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) { } } } }
/// <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) { } } } }
/// <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); }
/// <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); }