string localname(*i);
s=socket(AF_INET6,SOCK_DGRAM,0);
- Utility::setCloseOnExec(s);
if(s<0)
throw AhuException("Unable to acquire a UDPv6 socket: "+string(strerror(errno)));
+ Utility::setCloseOnExec(s);
+
ComboAddress locala(localname, ::arg().asNum("local-port"));
if(IsAnyAddress(locala)) {
for(vector<string>::const_iterator laddr=locals.begin();laddr!=locals.end();++laddr) {
int s=socket(AF_INET,SOCK_STREAM,0);
- Utility::setCloseOnExec(s);
if(s<0)
throw AhuException("Unable to acquire TCP socket: "+stringerror());
+ Utility::setCloseOnExec(s);
+
ComboAddress local(*laddr, ::arg().asNum("local-port"));
int tmp=1;
#if !WIN32 && HAVE_IPV6
for(vector<string>::const_iterator laddr=locals6.begin();laddr!=locals6.end();++laddr) {
int s=socket(AF_INET6,SOCK_STREAM,0);
- Utility::setCloseOnExec(s);
if(s<0)
throw AhuException("Unable to acquire TCPv6 socket: "+stringerror());
+ Utility::setCloseOnExec(s);
+
ComboAddress local(*laddr, ::arg().asNum("local-port"));
int tmp=1;