Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm assuming that you are putting a breakpoinit in the myPing_PingCompleted method but that when in debug mode its just not going there. Is that right? </p> <p>Is the code throwing some sort of error? If you step through the code, does it call the myPing.SendAsync with the right parameters?</p> <p>I just tried your code (without the IPQueue because that looks like your custom class). It works fine on my end. I used one valid IP and what IP that doesn't exist. It worked good in both cases.</p> <p><strong>Edit for new information</strong></p> <p>Ok i just tried it in a windows form application and IT DOES NOT WORK. When i tried it before it was in a unit test. Basically it would seem that the thread used to render the windows form and handle the events isn't capable of being used to create async requests (maybe because it is a foreground thread). But, you can get arround it pretty easily by creating another thread to do the ping. </p> <p>Actually, ideally that's how you would have to do it anyways. In order for the windows form app not to lock up when the thread is busy, a good principle is to do all backround work on a seperate thread. This would keep the windows form responsive. Be careful though, when trying to access Controls using backround threads an exception will be thrown. It is best to read all the values you want into private variables and then kick of a thread that will do all the work, have that thread update another set of variables and then have the forground thread read the variables and update the controls.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload