Link to home
Start Free TrialLog in
Avatar of JackOfPH
JackOfPHFlag for Philippines

asked on

System.net.networkInformation.ping causes my application to hang...

I created a class that will monitor if a certain device(with IP address) is connected to my network. But the method I am using causes my Application to hang...

Any ideas on how to achieve this?

Below is the code I am using... (Visual Basic 2005)



 Private Sub TimerTick(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'Application.DoEvents()
        ''System.Threading.Thread.Sleep(20)
        'Dim pingDevice As New System.Net.NetworkInformation.Ping
        'If pingDevice.Send(_IPAddress).Status = Net.NetworkInformation.IPStatus.Success Then
        '    AddHandler FingerPrintDevice.OnAttTransaction, AddressOf FingerScanningTransaction
        '    _isDeviceConnected = True
        'Else
        '    RemoveHandler FingerPrintDevice.OnAttTransaction, AddressOf FingerScanningTransaction
        '    _isDeviceConnected = False
        'End If

        'RaiseEvent DeviceStatus(_DeviceID, _DeviceName, _IPAddress, _isDeviceConnected)

    End Sub
ASKER CERTIFIED SOLUTION
Avatar of VikramMullick
VikramMullick

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JackOfPH

ASKER

Thanks for the help...

:)
Thanks for the tipo...