I am setting the socket option SO_BINDTODEVICE for eth0 to be able to route the packets only through that interface. However, bind() fails with "Port already in use" error with this option when the server is restarted despite having the socket option SO_REUSEADDR.
Here is my code snippet:
Is anything missing in the code above? I have tried the other way of getting IP address of the interface (eth0) and assigning it to sAddr.sin_addr.s_addr but that did not work.
Hope to get some details. Thanks in advance!!
Moderator's Comments:
Please use CODE tags as required by forum rules!
Last edited by RudiC; 05-30-2018 at 10:51 AM..
Reason: Added CODE tags.
Hi, I need to look at a recent copy of /usr/include/errno.h from AIX 7.2 to check some symbols. In particular, I'm curious if it defines EOWNERDEAD and ENOTRECOVERABLE. Can someone who has access to 7.2 please check for me? Thanks! (1 Reply)
sir.. i am working in a WAN......
i am getting the login screen for an application by typing the address of the location and the file name "http:/121.12.12.111/xyz.html" from the node 121.12.12.125.
now i had my web applicatioon at 121.12.12.125 for which i have taken the source code of the... (0 Replies)
Hey, Can I assume that for certain function calls, errno can never be set to a certain value.
More specifically, can I assume that for if the stat function call fails, the errno can never be or "No space left on device."
I am assuming that a read function cannot fail because of no space... (5 Replies)
The return value of the #? returns status of the executed command, i.e If it is 0 then SUCCESS, If it is non-zero value the it means FAILURE.
My doubt is how does the return status defined?
1,2,3,,,,,125.
Exp: if it returns 125,, how does it relates to failure? (1 Reply)
Hello,
I need to make a lib with pthread, when I run my make file all is good. But when I run my test program, I test errno in the begining and is already set to 251. Is it normal ??? What can I modify in my Makefile to have errno set to 0 ???
Thanks
$make
gcc -D_REENTRANT -shared -fpic... (3 Replies)