/// <summary>
 /// Sends the data to all outgoing client.
 /// </summary>
 /// <param name="data">The data.</param>
 public void SendData(object msg)
 {
     try
     {
         IMessage message = msg as IMessage;
         if (OutgoingClientCount > 0)
         {
             byte[] data  = ASCIIEncoding.ASCII.GetBytes(PortServiceHelper.GetSendCallDetailString(message));
             int    count = OutgoingClientCount;
             foreach (TcpClient client in OutGoingClients)
             {
                 if (CheckClientConnection(client) && !isdisconnect)
                 {
                     try
                     {
                         NetworkStream stream = client.GetStream();
                         stream.Write(data, 0, data.Length);
                         Thread.Sleep(10);
                         //stream.Close();
                     }
                     catch (Exception ex)
                     {
                         logger.Error("Error occurred while sending data as " + ex.Message);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         logger.Error("SendData() : " + ex.Message);
     }
 }