Fixed boneheaded mistake, where I set REUSEADDR for UDP instead of TCP

master
Aadhavan Srinivasan 9 months ago
parent fd4ad04aeb
commit 4ff840e91e

@ -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));
} }

Loading…
Cancel
Save