Multi ping check in same time

09-22-10, 05:02 AM
|
|
Newbie Coder
|
|
Join Date: Sep 2009
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
|
Multi ping check in same time
hello guys, i have app, should check ping with multi server and then say if they are offline or online, i just done it on one server, but in multi server it don't work, like i send 1 request and before first finish, i send second , and .....
so please help me.....
Language : C#
|

09-23-10, 08:50 AM
|
 |
Community VIP
|
|
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,171
Thanks: 3
Thanked 9 Times in 9 Posts
|
|
Quote:
Originally Posted by deadManN
hello guys, i have app, should check ping with multi server and then say if they are offline or online, i just done it on one server, but in multi server it don't work, like i send 1 request and before first finish, i send second , and .....
so please help me.....
Language : C#
|
Can you post the code that you have so far here? Would make it easier to help you.
Pete
|

09-23-10, 12:19 PM
|
|
Newbie Coder
|
|
Join Date: Sep 2009
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
|
|

09-23-10, 02:35 PM
|
 |
Code Master
|
|
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
|
|
Hi,
You will have to use a handler for each ping request. Probably now you get an error saying a previous Asynch request hasn't finished yet. Here's a part of your code and how I would handle it.
Add a tag to each panel with the name of the server.
So a for each panel loop
Create pinghandler (you have one so you can modify that one as needed):
And make a for each loop to loop through your servers and ping them:
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
Last edited by Yeroon; 09-23-10 at 02:40 PM.
|

09-23-10, 04:24 PM
|
|
Newbie Coder
|
|
Join Date: Sep 2009
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
cant understand the first part... and it ping all in same time ?!
cuz for example if a server has high latency it take several sec till app load fully .... and maybe people try to launche game on offline server before notice that ....
that's why i wanna send ping requests all at once ... BTW, if u expline first part ... since i don't use panel, i used an array .... i can't get panel and the tag ....
|

09-23-10, 09:28 PM
|
 |
Code Master
|
|
Join Date: Aug 2007
Location: Netherlands, Nijmegen
Posts: 850
Thanks: 2
Thanked 20 Times in 20 Posts
|
|
Hi I meant you use panels on your form where you color them. For the ping completed to know what panel to use, I use the tag of the panels to identify them. So the panels I mean are Panel1, Panel2 etc. I found them on the Form1.cs form. I assume that is the form that does the ping.
You fill an array of serverName (10 items max). And you have 10 panels.
Then add tag to Panel with:
The other ping completed code then has also the serverName for all the calls and you lookup[ the right panel and set the color to green (ok) or red (error).
And yes it does all the pings at the same time.
I hope this clears it up
__________________
Feel free to thank people if they help you by clicking thanks at a post.
=================================
Make it idiot proof and someone will make a better idiot.
=================================
Realise the impotence of proof reading everything you publish
|

09-24-10, 02:32 AM
|
|
Newbie Coder
|
|
Join Date: Sep 2009
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
this function don't work ....
and give me error.. i tried this in refresh function and formload handler...
int i = 0;
foreach (Panel p in this.Controls)
{
p.Tag = realmList.GetValue(i);
i++;
}
and one more question, the way these things work, if the person filled 3rd server realm, and put empty for 1st and second... what will happen? it gonna show ping of 3rd realm in 3rd panel, while in listBox it's on 1st slot ?!
and the way u said it check all at once... so my application wont hang for min? since i still couldn't test that due to error ... it say "Unable to cast object of type 'System.Windows.Forms.ProgressBar' to type 'System.Windows.Forms.Panel'."
///////////
edit:
one more thing... what if i gonna add other panel to my application ?! since once may i need new functionallity that need other panel
Last edited by deadManN; 09-24-10 at 02:44 AM.
|

09-24-10, 06:52 AM
|
|
Newbie Coder
|
|
Join Date: Sep 2009
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
One more thing.. dunno why can't edit last post....
i see you use e server name to assign to ping class
but really serverName is teh name i show in listBox, but realmList is the IP or server Url .....
|

09-24-10, 01:48 PM
|
|
Newbie Coder
|
|
Join Date: Sep 2009
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
hey, from morning i look taht when u come online, so u become on line  after 15 h of checking
|

09-24-10, 01:52 PM
|
|
Newbie Coder
|
|
Join Date: Sep 2009
Posts: 60
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Man , have to go to bank with my father, his eyes are weak so ...
i'll be back by 10 min
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|