2001-10-15 14:34:02 +00:00
|
|
|
#include <sys/types.h>
|
2003-11-06 20:47:59 +00:00
|
|
|
#ifndef __MINGW32__
|
2001-02-05 17:57:02 +00:00
|
|
|
#include <sys/socket.h>
|
2003-11-06 20:47:59 +00:00
|
|
|
#endif
|
2001-02-05 17:57:02 +00:00
|
|
|
#include "socket.h"
|
2003-11-06 20:47:59 +00:00
|
|
|
#include "windoze.h"
|
2001-02-05 17:57:02 +00:00
|
|
|
|
|
|
|
int socket_bind6_reuse(int s,const char *ip,uint16 port,uint32 scope_id) {
|
|
|
|
int one=1;
|
|
|
|
setsockopt(s,SOL_SOCKET,SO_REUSEADDR,&one,sizeof one);
|
2008-09-17 00:06:23 +00:00
|
|
|
#ifdef SO_REUSEPORT
|
|
|
|
setsockopt(s,SOL_SOCKET,SO_REUSEPORT,&one,sizeof one);
|
|
|
|
#endif
|
2003-11-06 20:47:59 +00:00
|
|
|
return winsock2errno(socket_bind6(s,ip,port,scope_id));
|
2001-02-05 17:57:02 +00:00
|
|
|
}
|