On Aug 22, 2008, at 11:12 AM, Luca Ciciriello wrote:

int sock_icmp = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);

returns always -1.

Where is my mistake? For me is the very first time using socket on Mac.


Is your application running as root? Attempts to create raw sockets don't work if your app isn't running as root. Also, when a low-level function like that returns an error, you can find out more about the error by looking at the "errno" variable.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to