summaryrefslogtreecommitdiff
path: root/stun/usages
diff options
context:
space:
mode:
authorLivio Madaro <livio.madaro@telecomitalia.it>2012-02-23 16:39:08 +0100
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2012-02-23 20:06:38 -0500
commit146ce0f8d7b075b34b633337567d9dbc34586029 (patch)
tree7f90ce5891a1786493af4e6360e1169d15136286 /stun/usages
parent7973ba49bd8ca25bb5e64c23dd37aebe472cd459 (diff)
downloadlibnice-146ce0f8d7b075b34b633337567d9dbc34586029.tar.gz
set nonblocking mode for socket on Windows
Diffstat (limited to 'stun/usages')
-rw-r--r--stun/usages/bind.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stun/usages/bind.c b/stun/usages/bind.c
index 34302e1..01f0fec 100644
--- a/stun/usages/bind.c
+++ b/stun/usages/bind.c
@@ -227,6 +227,10 @@ stun_trans_init (StunTransport *tr, int fd,
*/
static int stun_socket (int family, int type, int proto)
{
+#ifdef _WIN32
+ unsigned long set_nonblock=1;
+#endif
+
int fd = socket (family, type, proto);
if (fd == -1)
return -1;
@@ -236,6 +240,8 @@ static int stun_socket (int family, int type, int proto)
#endif
#ifdef O_NONBLOCK
fcntl (fd, F_SETFL, fcntl (fd, F_GETFL) | O_NONBLOCK);
+#elif defined _WIN32
+ ioctlsocket(fd, FIONBIO, &set_nonblock);
#endif
#ifdef MSG_ERRQUEUE