|
|
@ -52,10 +52,11 @@ SOCKET create_socket(int network, char transport) {
|
|
|
|
|
|
|
|
|
|
|
|
int newSock = socket(domain,type,0);
|
|
|
|
int newSock = socket(domain,type,0);
|
|
|
|
|
|
|
|
|
|
|
|
/* Set REUSEADDR flag, allowing program to be run twice */
|
|
|
|
/* Set REUSEADDR flag for TCP, allowing program to be run twice */
|
|
|
|
|
|
|
|
if (transport == ES_UDP) {
|
|
|
|
int set_opt = 1;
|
|
|
|
int set_opt = 1;
|
|
|
|
setsockopt(newSock, SOL_SOCKET, SO_REUSEADDR, (char *)&set_opt, sizeof(set_opt));
|
|
|
|
setsockopt(newSock, SOL_SOCKET, SO_REUSEADDR, (char *)&set_opt, sizeof(set_opt));
|
|
|
|
|
|
|
|
}
|
|
|
|
return newSock;
|
|
|
|
return newSock;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|