Пример #1
0
 /// <summary>
 /// Receive data from the server using the established socket connection
 /// </summary>
 /// <returns>The data received from the server</returns>
 public void Receive()
 {
     try
     {
         while (!Closing.WaitOne(1))
         {
             if (m_Parent.BytesToRead > 0)
             {
                 m_Parent.GXSerial_DataReceived(m_Parent, null);
             }
             else
             {
                 Closing.WaitOne(100);
             }
         }
     }
     catch (Exception ex)
     {
         m_Parent.NotifyError(ex);
         if (!Closing.WaitOne(1))
         {
             m_Parent.Close();
         }
     }
 }