Discussion:
setsockopt API always returns -1
Joe Petruchi
2009-04-22 12:40:29 UTC
Permalink
Hi

I have been trying to use setsockopt with option SO_BINDTODEVICE and option
value lo. The code is similar to this

printf("\nDevice name is %s\n",argv[3] );
retval=setsockopt(hSocket, SOL_SOCKET, SO_BINDTODEVICE, argv[3],
(strlen(argv[3])+1) );

if(retval<0)
{
printf("\nSetting socket options failed %d\n", retval);
return 0;
}

The setsockopt API is always returning -1. I am not able to understand the
problem. I tried running the same program on my ubuntu PC and it works fine
and the device is getting binded to the socket.

If anybody has faced the same problem please help

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-kernel+***@googlegroups.com
website: http://groups.google.com/group/android-kernel
-~----------~----~----~----~------~----~------~--~---

Loading...