diff options
Diffstat (limited to 'src/aio/usock_posix.inc')
-rw-r--r-- | src/aio/usock_posix.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/aio/usock_posix.inc b/src/aio/usock_posix.inc index f020a22..0d2f805 100644 --- a/src/aio/usock_posix.inc +++ b/src/aio/usock_posix.inc @@ -1,7 +1,7 @@ /* Copyright (c) 2013 Martin Sustrik All rights reserved. Copyright (c) 2013 GoPivotal, Inc. All rights reserved. - Copyright 2016 Garrett D'Amore <garrett@damore.org> + Copyright 2017 Garrett D'Amore <garrett@damore.org> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -290,10 +290,14 @@ int nn_usock_bind (struct nn_usock *self, const struct sockaddr *addr, /* The socket can be bound only before it's connected. */ nn_assert_state (self, NN_USOCK_STATE_STARTING); + /* Windows Subsystem for Linux - SO_REUSEADDR is different, + and the Windows semantics are very wrong for us. */ +#ifndef NN_HAVE_WSL /* Allow re-using the address. */ opt = 1; rc = setsockopt (self->s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof (opt)); errno_assert (rc == 0); +#endif rc = bind (self->s, addr, (socklen_t) addrlen); if (nn_slow (rc != 0)) |