|
Dear Sir
look to the following part of ur code
void CPing::Ping(UINT nRetries,LPCSTR pstrHost,HWND hWnd)
{
...
for (nLoop = 0; nLoop < nRetries; nLoop++)
{
SendEchoRequest(rawSocket, &saDest);
....
}
so if i said ping 100 times , such 100 times will all done inside the ping func. itself which will be trigger by one thread
UINT CPingThread::ThreadProc(void* lpParam)
{
...
.
.
if (dwWait == WAIT_OBJECT_0 + 1)
pThis->m_ping.Ping(pThis->m_nRetries,pThis->m_strHost, pThis->m_hWnd);
.
.
the real mutli-thread we should have 100 thread each make one ping ??
am i right??
or there is misunderstanding
thanks
modified on Thursday, December 4, 2008 5:02 PM
|
|
|
|
|
Any ideas anyone?
Regards
|
|
|
|
|
working fine on my vista box.
|
|
|
|
|
Winping is not working on Vista.
Its giving error "Socket()-WSAError 10013"
|
|
|
|
|
"An attempt was made to access a socket in a way forbidden by its access permissions. "
Try running as administrator.
Also make sure you don't do a broadcast like 255.255.255.255
|
|
|
|
|
Why must be administrator?
|
|
|
|
|
|
|
Thanks very much i needed a code as yours ;D
---
|
|
|
|
|
Hi!
I making this program to an console app. Because of that I need to change the code. In debuging mode, after calling rawSocket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
The socket is SOCKET == ERROR and goes into Error mode instead of going to the OnPing as it does in the winapp.
Why does the compiler go to OnTimer after that the socket funktion is called?
Look here
Debug:
....
....
-> rawSocket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
-> void CWinPingDlg::OnTimer(UINT nIDEvent)
...
...
I am nott familiar with sockets!
Any suggestions?
GOgo
|
|
|
|
|
when my firewall is open this ping program cannot ping to the web server,please tell me how to change this program to ping to the web server when the firewall is open.
I appreciate your help.
|
|
|
|
|
Hey there,
Hope you still visit this article, as am having problems with ping application of mine which has similar logic as your app and some how windows firewall blocks ICMP packets, was wondering if there is a way around.
thanks
Rahul
|
|
|
|
|
hi!
good work!
i.m playing with it....
now it maintains an ip-ranges
like that: 192.168.*.*
good luck !
|
|
|
|
|
|
WSA Error 10022 comes out
when run in windows XP SP2
may i know what is the cause and how to solve it
thanks
|
|
|
|
|
hi! are the sources files of the ping are updated without the bug??? please let me know!!! and ansere!! cu surf.
|
|
|
|
|
Hello,
I have a short question.
I open this ping-dialog as a non-modal dialog and the ping request is send (for example 10 retries). I can close the dialog, but I can't do anything in the parent dialog, because the ping is also running in background. After a few seconds, when the ping is over all is ok.
How can I stop the ping-thread when the non-modal dialog should be close???
Thanxx
Jessica
|
|
|
|
|
I tried to do a broadcast ping in my application but it gives me a runtime error. By the way, I am working in Windows 2000 server and use winSock2.h to deal with sockets. I feel that you will give me part of your time to answer me. I will ask you another favore, if you know any good E_books to learn the network programming.
thank you. . . .
|
|
|
|
|
HI
when I try to run WinPing under Windows XP envirment
I get SOCKET_ERROR in the following code:
rawSocket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
something wrong with the system or any ideas?
How can I solve the problem?
thanks
|
|
|
|
|
you must initlaize socket before creating socket
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
|
|
|
|
|
maybe you forgot to initialize the socket envirment with afxsockinit function.
|
|
|
|
|
I ran this application twice and the ping response
of the first ping appears on the second application.
|
|
|
|
|
Hi, please see my message at:
http://www.codeproject.com/internet/winping.asp?df=100&forumid=905&select=445021#xx445021xx
the next to your message.
Regards,
Hanney
|
|
|
|
|
Scene - 1: Use the executable to ping a dead host (ie. 129.133.156.100), 50 retries, start to ping, it should always receive a timeout message.Well, start a command window now, use windows ping to ping an active host (ie. 127.0.0.1), see what happend in WinPing window -- it got a reply, why?
Scene - 2: Use the executable to ping a dead host (ie. 129.133.156.100), 50 retries, start to ping, it should always receive a timeout message.Well, start another WinPing window now and ping an active host (ie. 127.0.0.1), see what happend in WinPing window
-- it got a reply, why?
Regards,
Hanney Wang
|
|
|
|
|
WinPing have this bug because it don't test if a icmp packet received is an answer for it.
In other words, Windows give to WinPing all icmp packets are received(included answer pings for other winping instances), and in the RecvEchoReply functions, you must verify what packets are yours. One method is used to solve this, is save in the id field of icmp header the process id and compare the value of this in all icmp packets received.
|
|
|
|