Overview
Features
Download
Documentation
Community
Add-Ons & Services

[SOLVED]POCO Net Ping sample can't ping localhost

Please post support and help requests here.

[SOLVED]POCO Net Ping sample can't ping localhost

Postby panovr » 28 Apr 2012, 05:20

In POCO Net Ping sample, I find this in "Ping.cpp":
Code: Select all
Ping():
      _helpRequested(false),
      _icmpClient(IPAddress::IPv4),
      _repetitions(4),
      _target("localhost")
   {
   }

If I understand correctly, it support to ping "localhost".

However, if I invoke this program, there was an error:
Code: Select all
F:\lib\poco-1.4.3p1\Net\samples\Ping\bin\static_mt>Ping
I/O error: Permission denied


Also, if I invoke this program with target parameter, there was also an error:
Code: Select all
F:\lib\poco-1.4.3p1\Net\samples\Ping\bin\static_md>Ping /target=www.google.com
I/O error: Permission denied


My OS is Windows 7, 64 bit, Visual Studio 2010.

Is this a bug of POCO windows edition?
Last edited by panovr on 01 May 2012, 15:29, edited 2 times in total.
panovr
 
Posts: 11
Joined: 18 Apr 2012, 16:23

Re: POCO Net Ping sample can't ping localhost

Postby Sqarzz » 28 Apr 2012, 09:07

Just an idea, but did you tried running vs2010 with Admin rights?
Sqarzz
 
Posts: 24
Joined: 09 Apr 2012, 11:11
Location: Belgium

Re: POCO Net Ping sample can't ping localhost

Postby alex » 29 Apr 2012, 01:31

Set linker option for manifest UAC execution level to 'highestAvailable' (/level='highestAvailable'):
Code: Select all
Properties -> Linker -> Manifest File -> UAC Execution Level -> highestAvailable
alex
 
Posts: 1125
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: POCO Net Ping sample can't ping localhost

Postby panovr » 29 Apr 2012, 09:45

I tried POCO Net sample - Ping on Ubuntu 12.04, also got the similar errors:

1. Ping locahost
Code: Select all
ylzhao@ylzhao-Inspiron-620:~/lib/poco-1.4.3p1-all/Net/samples/Ping/bin/Linux/x86_64$ ./Ping
I/O error: 1

2. Ping remote host
Code: Select all
ylzhao@ylzhao-Inspiron-620:~/lib/poco-1.4.3p1-all/Net/samples/Ping/bin/Linux/x86_64$ ./Ping --target=www.google.com
I/O error: 1
panovr
 
Posts: 11
Joined: 18 Apr 2012, 16:23

Re: POCO Net Ping sample can't ping localhost

Postby alex » 29 Apr 2012, 15:28

panovr wrote:I tried POCO Net sample - Ping on Ubuntu 12.04, also got the similar errors:

Run tests as root (or sudo). ICMPSocket is raw and needs root privileges.
alex
 
Posts: 1125
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: POCO Net Ping sample can't ping localhost

Postby panovr » 01 May 2012, 04:14

alex wrote:Set linker option for manifest UAC execution level to 'highestAvailable' (/level='highestAvailable'):
Code: Select all
Properties -> Linker -> Manifest File -> UAC Execution Level -> highestAvailable


If I open the console window as Administrator, then I can Ping localhost correctly.

It seems that the problem is related UAC on Windows 7, and not to POCO.

Thanks alex!
panovr
 
Posts: 11
Joined: 18 Apr 2012, 16:23

Re: POCO Net Ping sample can't ping localhost

Postby panovr » 01 May 2012, 15:27

alex wrote:
panovr wrote:I tried POCO Net sample - Ping on Ubuntu 12.04, also got the similar errors:

Run tests as root (or sudo). ICMPSocket is raw and needs root privileges.


Thanks for the tip, and invoke Ping as sudo can Ping localhost on Ubuntu 12.04.
panovr
 
Posts: 11
Joined: 18 Apr 2012, 16:23


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests