I have an array of ip address which contains a set of ip address, which is to be communicated from server. Example: There are 5 clients. 4's Ip address out of this 5 will be stored in an ip address array. The remaining one will be blocked at the time of sending messages from server. How it will be done. My sending message Code is shown below.
private void buttonSendMsg_Click(object sender, EventArgs e)
{
try
{
Object objData = richTextBoxSendMsg.Text;
byData = System.Text.ASCIIEncoding.ASCII.GetBytes(objData.ToString());
for (int i = 0; i < m_clientCount; i++)
{
if (m_workerSocket[i] != null)
{
if (m_workerSocket[i].Connected)
{
m_workerSocket[i].Send(byData);
}
}
}
}
catch (SocketException se)
{
MessageBox.Show(se.Message);
}
}