SendPingAsync makes form freeze
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: SendPingAsync makes form freeze
Great. I actually learned a bit about the newer Net Ping as it now does its own threading and likely uses some good threading tricks. Because I was not familiar with this I decided to build a quick demo. Here is a full demo of a good way to use this in a form.
- Attachments
-
- Demo-PingFast.psf
- (30.09 KiB) Downloaded 95 times
Re: SendPingAsync makes form freeze
Great. I looked through it and it seems akin to what I did. I used the Sapien button - start job control though so your script takes up fewer lines. I think your way could make it more viewable for other people i they decide to edit it at one point.
Thanks.
I finished the tool and the attached images show the result. I might add Round Trip Time as well but I need to examine how precise it is on a single ping.
IpRangePingTool.png:
* A.) IP address that is validated as one types it in. IP address just needs to be within the range you need (Thanks to the Get-IPrange function mentioned earlier).
* B.)Either CIDR or Subnet-mask. If one is validated it fills out the other.
* C.) Only opens up when no errorprovider is active. It is the Button - Start Job control from PS Studio which starts SendPingAsync.
* D.) Can filter the result. I use the DefaultView.RowFilter which is one of the advantages of DataTables. It takes up a single line and it doesn't seem to build the table from the beginning. I did think this would be much faster than building a new result by convertto-datatable $result | where{} but they actually seemed to be pretty equal (didn't time it), however it saves a lot of resources and the wait is only really noticeable at 5000+ entries. It is also very understandable why this happens as I imagine that a standard datatable is not nearly as optimized as a database. There is a lot going on in the background.
2018-07-10_15-21-36.png:
Just shows the error provider that verifies octets are within the allowed range. I have made validations for every wrong entry that I could conceive.
Thanks.
I finished the tool and the attached images show the result. I might add Round Trip Time as well but I need to examine how precise it is on a single ping.
IpRangePingTool.png:
* A.) IP address that is validated as one types it in. IP address just needs to be within the range you need (Thanks to the Get-IPrange function mentioned earlier).
* B.)Either CIDR or Subnet-mask. If one is validated it fills out the other.
* C.) Only opens up when no errorprovider is active. It is the Button - Start Job control from PS Studio which starts SendPingAsync.
* D.) Can filter the result. I use the DefaultView.RowFilter which is one of the advantages of DataTables. It takes up a single line and it doesn't seem to build the table from the beginning. I did think this would be much faster than building a new result by convertto-datatable $result | where{} but they actually seemed to be pretty equal (didn't time it), however it saves a lot of resources and the wait is only really noticeable at 5000+ entries. It is also very understandable why this happens as I imagine that a standard datatable is not nearly as optimized as a database. There is a lot going on in the background.
2018-07-10_15-21-36.png:
Just shows the error provider that verifies octets are within the allowed range. I have made validations for every wrong entry that I could conceive.
- Attachments
-
- 2018-07-10_15-21-36.png (18.63 KiB) Viewed 1452 times
-
- IpRangePingTool1.png (57.44 KiB) Viewed 1452 times
Re: SendPingAsync makes form freeze
Excellent. Looks very easy to use and very useful for large pings.
One note - What you are calling CIDR is really just mask length. A CIDR is a network number plus mask length.
CIDR = 10.0.10.0/24
It is the notation used by classless routing schemes and goes beyond the segment notation. CIDR allows providers to gather disconnected segment into a single net. Mostly this has been made unnecessary by IPv6.
One note - What you are calling CIDR is really just mask length. A CIDR is a network number plus mask length.
CIDR = 10.0.10.0/24
It is the notation used by classless routing schemes and goes beyond the segment notation. CIDR allows providers to gather disconnected segment into a single net. Mostly this has been made unnecessary by IPv6.
Re: SendPingAsync makes form freeze
Thank you. I am hoping this can help my colleagues around on other sites as a first step in getting documented everything. We have some large ranges and not everything is documented. This should help by telling what addresses have endpoints to compare to the documentation.
Plus it is fun to make.
I do think I am going to add a button for exporting current output to CSV and/or Excel though. They can copy it from the Data table if they wish, but it is a nice option to have.
In regards to CIDR: Thanks, you are right. I will call it Mask length instead.
Thanks for all your help.
Plus it is fun to make.
I do think I am going to add a button for exporting current output to CSV and/or Excel though. They can copy it from the Data table if they wish, but it is a nice option to have.
In regards to CIDR: Thanks, you are right. I will call it Mask length instead.
Thanks for all your help.