Beispiel #1
0
        internal void StartSearch(string EndPoint, CSearchUDP _externalSearcherUDP)
        {
            EndPointSearch = EndPoint.Trim();
            if (ReferenceEquals(searchStationsUPD, null))
            {
                // por si se vuelve a llamar a StartSearch
                if (_externalSearcherUDP != null)
                {
                    bExternalSearcherUDP = true;
                    searchStationsUPD    = _externalSearcherUDP;
                }
                else
                {
                    bExternalSearcherUDP = false;
                    searchStationsUPD    = new CSearchUDP();
                }
                searchStationsUPD.Refresh += searchStationsUPD_Refresh;
            }

            iRefreshUDPCount = 0;
            bRefreshUDPForce = true;
            if (!searchStationsUPD.IsSearching())
            {
                StartUDPDiscover();
            }
            m_StatusConnect         = StatusConnect.WaitSearch;
            m_Timer_Search.Interval = MS_WAIT_SEARCH;
            m_Timer_Search.Enabled  = true;
        }
        private void Initialize(CSearchUDP _externalSearcherUDP)
        {
            // VBConversions Note: Non-static class variable initialization is below.  Class variables cannot be initially assigned non-static values in C#.
            InstanciaHijo              = new CSearchConnectTCP_Base(this);
            InstanciaHijo.PasaRefHijo += InstanciaHijo1_PasaRefHijo;

            externalSearcherUDP = _externalSearcherUDP;

            ThreadHijo1      = new Thread(new System.Threading.ThreadStart(InstanciaHijo.CrearNuevoProceso));
            ThreadHijo1.Name = "SearchConnectTCP_Base";
            ThreadHijo1.SetApartmentState(ApartmentState.STA);
            ThreadHijo1.Start();
        }
Beispiel #3
0
        internal void Eraser()
        {
            StopSearch();
            m_Timer_Search.Dispose();
            m_Timer_Search = null;

            if (!bExternalSearcherUDP)
            {
                searchStationsUPD.Eraser();
                searchStationsUPD = null;
            }
            discoveredStations.Reset();
            discoveredStations = null;
        }
 public CSearchDevicesTCP(string EndPoint, CSearchUDP _externalSearcherUDP)
 {
     Initialize(_externalSearcherUDP);
     // guardamos el end point solicitado
     EndPointSearch = EndPoint;
 }
 public CSearchDevicesTCP(CSearchUDP _externalSearcherUDP)
 {
     Initialize(_externalSearcherUDP);
 }