|
|
@ -53,7 +53,7 @@ SOCKET create_socket(int network, char transport) {
|
|
|
|
int newSock = socket(domain,type,0);
|
|
|
|
int newSock = socket(domain,type,0);
|
|
|
|
|
|
|
|
|
|
|
|
/* Set REUSEADDR flag for TCP, allowing program to be run twice */
|
|
|
|
/* Set REUSEADDR flag for TCP, allowing program to be run twice */
|
|
|
|
if (transport == ES_UDP) {
|
|
|
|
if (transport == ES_TCP) {
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
}
|
|
|
|