aboutsummaryrefslogtreecommitdiffhomepage
path: root/unix.c
diff options
context:
space:
mode:
authoreihrul <eihrul>2006-07-06 21:22:41 +0000
committereihrul <eihrul>2006-07-06 21:22:41 +0000
commit1d6253cc3d63801cc4077ff4621e31cf53cc75f9 (patch)
tree7ec5c09bcc3f39afa21c72ca1a9efc3d8caaa656 /unix.c
parent1e2c45adf961f878b29b5df111153ee9a084c9d3 (diff)
downloadenet-1d6253cc3d63801cc4077ff4621e31cf53cc75f9.tar.gz
enet-1d6253cc3d63801cc4077ff4621e31cf53cc75f9.zip
*** empty log message ***
Diffstat (limited to 'unix.c')
-rw-r--r--unix.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/unix.c b/unix.c
index 3772fef..75385a8 100644
--- a/unix.c
+++ b/unix.c
@@ -80,7 +80,7 @@ enet_address_set_host (ENetAddress * address, const char * name)
char buffer [2048];
int errnum;
-#ifdef linux
+#if defined(linux) || defined(FREEBSD)
gethostbyname_r (name, & hostData, buffer, sizeof (buffer), & hostEntry, & errnum);
#else
hostEntry = gethostbyname_r (name, & hostData, buffer, sizeof (buffer), & errnum);
@@ -118,7 +118,7 @@ enet_address_get_host (const ENetAddress * address, char * name, size_t nameLeng
in.s_addr = address -> host;
-#ifdef linux
+#if defined(linux) || defined(FREEBSD)
gethostbyaddr_r ((char *) & in, sizeof (struct in_addr), AF_INET, & hostData, buffer, sizeof (buffer), & hostEntry, & errnum);
#else
hostEntry = gethostbyaddr_r ((char *) & in, sizeof (struct in_addr), AF_INET, & hostData, buffer, sizeof (buffer), & errnum);
@@ -153,6 +153,7 @@ enet_socket_create (ENetSocketType type, const ENetAddress * address)
{
ENetSocket newSocket = socket (PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
int receiveBufferSize = ENET_HOST_RECEIVE_BUFFER_SIZE,
+ sendBufferSize = ENET_HOST_SEND_BUFFER_SIZE,
allowBroadcasting = 1;
#ifndef HAS_FCNTL
int nonBlocking = 1;
@@ -171,6 +172,7 @@ enet_socket_create (ENetSocketType type, const ENetAddress * address)
#endif
setsockopt (newSocket, SOL_SOCKET, SO_RCVBUF, (char *) & receiveBufferSize, sizeof (int));
+ setsockopt (newSocket, SOL_SOCKET, SO_SNDBUF, (char *) & sendBufferSize, sizeof (int));
setsockopt (newSocket, SOL_SOCKET, SO_BROADCAST, (char *) & allowBroadcasting, sizeof (int));
}