diff --git a/build/Debug/GNU-Linux/library/connection.o b/build/Debug/GNU-Linux/library/connection.o index 175255f..0c3bfa6 100644 Binary files a/build/Debug/GNU-Linux/library/connection.o and b/build/Debug/GNU-Linux/library/connection.o differ diff --git a/dist/Debug/GNU-Linux/uftp b/dist/Debug/GNU-Linux/uftp index b621134..7a37174 100755 Binary files a/dist/Debug/GNU-Linux/uftp and b/dist/Debug/GNU-Linux/uftp differ diff --git a/library/connection.c b/library/connection.c index 3a5773b..7d7dd6f 100644 --- a/library/connection.c +++ b/library/connection.c @@ -71,12 +71,16 @@ int createSocket(ftpDataType * ftpData) errorCode = fcntl(sock, F_SETFL, O_NONBLOCK); int reuse = 1; + +#ifdef SO_REUSEADDR if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char*)&reuse, sizeof(reuse)) < 0) perror("setsockopt(SO_REUSEADDR) failed"); +#endif +#ifdef SO_REUSEPORT if (setsockopt(sock, SOL_SOCKET, SO_REUSEPORT, (const char*)&reuse, sizeof(reuse)) < 0) perror("setsockopt(SO_REUSEPORT) failed"); - +#endif //Bind socket errorCode = bind(sock,(struct sockaddr*) &temp,sizeof(temp));