summaryrefslogtreecommitdiffhomepage
path: root/win32.c
diff options
context:
space:
mode:
authoreihrul <eihrul>2005-06-08 01:13:28 +0000
committereihrul <eihrul>2005-06-08 01:13:28 +0000
commitfd57f842d5e45fe8642cc0dd4ba73de359e0db37 (patch)
tree4d56250344590f7326663d5e2acd0788b787f847 /win32.c
parent59d5c26e3811e0ebfa4878e29886d8f4aadbdd6f (diff)
downloadenet-fd57f842d5e45fe8642cc0dd4ba73de359e0db37.tar.gz
enet-fd57f842d5e45fe8642cc0dd4ba73de359e0db37.zip
added broadcasting
Diffstat (limited to 'win32.c')
-rw-r--r--win32.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/win32.c b/win32.c
index c5c1959..b2ff017 100644
--- a/win32.c
+++ b/win32.c
@@ -88,8 +88,9 @@ ENetSocket
enet_socket_create (ENetSocketType type, const ENetAddress * address)
{
ENetSocket newSocket = socket (PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
- u_long nonBlocking = 1,
- receiveBufferSize = ENET_HOST_RECEIVE_BUFFER_SIZE;
+ u_long nonBlocking = 1;
+ int receiveBufferSize = ENET_HOST_RECEIVE_BUFFER_SIZE,
+ allowBroadcasting = 1;
struct sockaddr_in sin;
if (newSocket == ENET_SOCKET_NULL)
@@ -100,6 +101,7 @@ enet_socket_create (ENetSocketType type, const ENetAddress * address)
ioctlsocket (newSocket, FIONBIO, & nonBlocking);
setsockopt (newSocket, SOL_SOCKET, SO_RCVBUF, (char *) & receiveBufferSize, sizeof (int));
+ setsockopt (newSocket, SOL_SOCKET, SO_BROADCAST, (char *) & allowBroadcasting, sizeof (int));
}
memset (& sin, 0, sizeof (struct sockaddr_in));