|
Hi, I've had a quick go
- CPING_USE_ICMP : eVC4 reported that 'failed to load ICMP.dll'
or
- for CPING_USE_WINSOCK2 , "CPing::Ping2, Failed to create a raw socket "
I don't think winsock2 is implemented in WinCE though.
Do you know of any fixes for these? I'm unfamiliar with ICMP.dll and don't know if it supported by WinCE.
|
|
|
|
|
If you are using CE, check out the function IcmpSendEcho
|
|
|
|
|
Does this code work with IPv6?
I don't have any machines using IPv6 to test it,
so I'm asking it here.
thx
|
|
|
|
|
No it does not support IPv6, for that check out the function Icmp6SendEcho2
|
|
|
|
|
Hello
I've downloaded the newest version from your website, but the problem is i get the same RTT every time, and the RTT is the same for several ip.
I pinged using icmp, and the ping code has its own thread.
Thanks
|
|
|
|
|
Hi,
I use the CPing class with the function CPing::PingUsingWinsock, but the statements
//Send of the packet
int nWrote = sendto(sockRaw, pICMP, nPacketSize, 0, (sockaddr*)&dest, sizeof(dest));
if (nWrote == SOCKET_ERROR)
{
TRACE(_T("CPing::PingUsingWinsock, sendto failed\n"));
fails. WSAGetLastError() says that Error "WSAEACCES" (10013) occurs.
I logged in as normal Windows user with user-rights
If I use CPing::PingUsingICPM everything works fine.
The function CPing::PingUsingWinsock only works if I logged in at the XP-PC with admin rights.
CPing::PingUsingICPM works with admin and user rights
Has anyone a solution for the problem ?
I have downloaded the newest Version (1.37) for www.naughter.com.
Jörg Tiedemann
|
|
|
|
|
Has same problem. Ping1() does not work with admin privilege.
|
|
|
|
|
Have same problem. Ping1() does not work with admin privilege.
|
|
|
|
|
Have same problem.
"An attempt was made to access a socket in a way forbidden by its access permissions."
Anyone know if there is a way to use raw sockets when running as a limited user in XP SP2?
|
|
|
|
|
I am testing after delte ICMP echo option on windowsXP service pack2.
CPing can't receive Ping Echo.
Teach me..How to receive Ping Echo On windowsXP(with service pack2)
|
|
|
|
|
Just tested the latest version from my web site at www.naughter.com on XP SP2 and I see know problems. I'd suggest you download the latest version and run the code under the debugger to see what is happening. Also have a look at the html documentation which comes with the download
|
|
|
|
|
I am using MFC Socket classes in my project so I'm including afxsock.h header file. When I try to insert the CPing class I must include winsock2.h also, and I get serveral redefinitions. How can I fix these problems?
Thanks.
|
|
|
|
|
The MFC socket classes uses Winsock 1.1 and my raw sockets ping use Winsock 2.0. I'm not really sure how you would go about combining the two in one program (or in fact if you should). I suggest you ditch one or the other. For example use the ICMP version in the ping class. You can exclude the winsock 2 method in my class via a preprocessor directive of "CPING_NO_WINSOCK2". Also try putting winsock2.h before your afxsock.h include.
|
|
|
|
|
How do i get the time it took to go to the server and ping it? The rTTL has been the same everytime I used it.
-Steven
CP Addict
By reading this message you are held fully responsible for any of the mispelln's or grammer, issues, found on, codeproject.com.
For those who were wondering, actual (Linux) Penguins were harmed in creating this message.
|
|
|
|
|
First thing to do is make sure you have the latest version from my web site (www.naughter.com) as this class is now up to v1.32. Also remember on a lan that ping times can be < 10 ms, which is below the nominal timer resolution on Windows 2000 / XP.
|
|
|
|
|
Hi,
After I sorted out the problem of my previous Error 87 (which had been caused by one of the #define new DEBUG_NEW in ping.cpp) I now have the following behavior:
When I try to ping the ftp.download.com I get 11013 back, whereas my ping on the commandline says it can ping it well.
Why is this ? Any idea ?
PS: I'm currently building this as a small example for a PowerBuilder nonvisual extension (PBNI)
|
|
|
|
|
I had a look for this error in the SDK includes, you will see in winerror.h:
// MessageId: WSA_QOS_BAD_OBJECT
//
// MessageText:
//
// Problem with some part of the filterspec or providerspecific buffer in general.
//
#define WSA_QOS_BAD_OBJECT 11013L
Which I'm not sure what that means. I'd suggest you search in the MSDN or Google for references to this. Also I will disable any QOS drivers you have on that machine and see what happens.
|
|
|
|
|
Is there a way to get a better error message ?
I'm looking eg. for what is errorcode 87.
|
|
|
|
|
Just look the error up in the SDK include file "winerror.h". Here it is:
//
// MessageId: ERROR_INVALID_PARAMETER
//
// MessageText:
//
// The parameter is incorrect.
//
#define ERROR_INVALID_PARAMETER 87L // dderror
Also debug through the code to see where the code is failing.
|
|
|
|
|
i want to retrieve the IP address of the machine using VC++
calls
|
|
|
|
|
Not that it is related to my ping class, but just use gethostname followed by gethostbyname
|
|
|
|
|
When the packet size set to 1024 bytes the defined maximum size, there are an error occurred with lack of recv buffer.
I think the meaning of packet size makes confused. The packet size should be included the ICMP header, so the code of buffer allocation might be as follows,
CPing:Ping2(....)
{
....
//Allocate the ICMP packet
char* pICMP = new char[nPacketSize];
FillIcmpData((LPICMP_HEADER) pICMP, nPacketSize);
......
//allocate the recv buffer
int nRecvBuf = nPacketSize + sizeof(IP_HEADER);
char* pRecvBuf = new char[nRecvBuf];
......
nRead = recvfrom(sockRaw, pRecvBuf, nRecvBuf, 0, (sockaddr*)&from,
&nFromlen);
.....
}
=======================================================================
When the packet size set to 8 the defined minimum size, there is also an error occurred. Because the sizeof(ICMP_HEADER) is 12 not 8.(because of the non standard field ULONG timestamp;) So the FillIcmpData() will overwrite the buffer.
|
|
|
|
|
The 'IP VERSION' and 'IP HEADER LENGTH' should be 4 bits not 4 bytes.
typedef struct tagIP_HEADER
{
unsigned char h_len:4; // length of the header
unsigned char version:4; // Version of IP
....
}
|
|
|
|
|
They are. Make sure you have the latest version from my web site at www.naughter.com
|
|
|
|
|
Hi,there
How to change the time interval?
I find a sentence : sleep(1000); Is this one?
I hope to change to 10 minutes as the time interval.
And when I build the ping.exe,one error occured:
_beginthreadex undeclaired identifier
How to correct it?
Thanks a lot!
XYZ
|
|
|
|