private void DataReceivedSync(object e)
 {
     try
     {
         GenericTcpEventArgs e1 = (GenericTcpEventArgs)e;
         if (DataReceived != null)
         {
             DataReceived(this, e1);
         }
     }
     catch (Exception ex)
     {
         //Dim dbg = 0
     }
 }
 protected void OnDataReceived(GenericTcpEventArgs e)
 {
     if (m_synchronizationContext != null)
     {
         try
         {
             m_synchronizationContext.Post(DataReceivedSync, e);
         }
         catch
         {
         }
     }
     else
     {
         if (DataReceived != null)
         {
             DataReceived(this, e);
         }
     }
 }