mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Broadcast now enabled on socket.
This commit is contained in:
parent
ee331fd73b
commit
63375b68b6
|
@ -103,7 +103,7 @@ int receivepacket(IP_Port * ip_port, uint8_t * data, uint32_t * length)
|
||||||
port is in host byte order (this means don't worry about it)
|
port is in host byte order (this means don't worry about it)
|
||||||
returns 0 if no problems
|
returns 0 if no problems
|
||||||
returns -1 if there are problems */
|
returns -1 if there are problems */
|
||||||
int init_networking(IP ip ,uint16_t port)
|
int init_networking(IP ip, uint16_t port)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
|
@ -144,6 +144,11 @@ int init_networking(IP ip ,uint16_t port)
|
||||||
return -1;
|
return -1;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
/*Enable broadcast on socket*/
|
||||||
|
int broadcast = 1;
|
||||||
|
setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (char*)&broadcast, sizeof(broadcast));
|
||||||
|
|
||||||
|
|
||||||
/* Set socket nonblocking */
|
/* Set socket nonblocking */
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
/* I think this works for windows */
|
/* I think this works for windows */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user