I am using the sample of given link for ping the given list of IP
http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio/example/icmp/ping.cpp
when ever i try ping a IP i am getting this exception at the initialization time itself
Exception open: An attempt was made to access a socket in a way forbidden by its access permissions
What causing this problem?
i am running it on windows 7 64 bit
For security reasons, some systems limit the use of raw sockets to users with administrator permissions. Boost.Asio's ICMP socket implementation uses raw sockets, and thus requires the application to run with administrator permissions. The Windows documentation states:
Raw sockets offer the capability to manipulate the underlying transport, so they can be used for malicious purposes that pose a security threat. Therefore, only members of the Administrators group can create sockets of type
SOCK_RAWon Windows 2000 and later.
Windows provides an IcmpSendEcho() family of functions that can be used to send and handle ICMP echo request/response without requiring administrative permissions, as the raw sockets are not exposed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With