added SO_REUSEADDR to nwio
This commit is contained in:
@ -320,6 +320,11 @@ int qse_nwio_init (
|
||||
{
|
||||
qse_nwio_hnd_t handle;
|
||||
|
||||
{
|
||||
int optval = 1;
|
||||
setsockopt (nwio->handle, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, QSE_SIZEOF(optval));
|
||||
}
|
||||
|
||||
if (bind (nwio->handle, (struct sockaddr*)&addr, addrlen) == SOCKET_ERROR)
|
||||
{
|
||||
nwio->errnum = syserr_to_errnum (WSAGetLastError());
|
||||
@ -370,6 +375,11 @@ int qse_nwio_init (
|
||||
{
|
||||
qse_nwio_hnd_t handle;
|
||||
|
||||
{
|
||||
int optval = 1;
|
||||
setsockopt (nwio->handle, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, QSE_SIZEOF(optval));
|
||||
}
|
||||
|
||||
if (bind (nwio->handle, (struct sockaddr*)&addr, addrlen) <= -1)
|
||||
{
|
||||
nwio->errnum = syserr_to_errnum (sock_errno());
|
||||
@ -431,6 +441,13 @@ int qse_nwio_init (
|
||||
{
|
||||
qse_nwio_hnd_t handle;
|
||||
|
||||
#if defined(SO_REUSEADDR)
|
||||
{
|
||||
int optval = 1;
|
||||
setsockopt (nwio->handle, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, QSE_SIZEOF(optval));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (bind (nwio->handle, (struct sockaddr*)&addr, addrlen) <= -1)
|
||||
{
|
||||
nwio->errnum = syserr_to_errnum (errno);
|
||||
|
@ -554,9 +554,7 @@ int qse_pio_init (
|
||||
posix_spawn_file_actions_t fa;
|
||||
int fa_inited = 0;
|
||||
int pserr;
|
||||
#if defined(__linux)
|
||||
posix_spawnattr_t psattr;
|
||||
#endif
|
||||
qse_pio_pid_t pid;
|
||||
param_t param;
|
||||
extern char** environ;
|
||||
@ -1390,8 +1388,8 @@ create_process:
|
||||
goto oops;
|
||||
}
|
||||
|
||||
#if defined(__linux)
|
||||
posix_spawnattr_init (&psattr);
|
||||
#if defined(__linux)
|
||||
#if !defined(POSIX_SPAWN_USEVFORK)
|
||||
# define POSIX_SPAWN_USEVFORK 0x40
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user