|
|
|
@ -124,12 +124,7 @@ srs_error_t srs_fd_reuseport(int fd)
|
|
|
|
|
#if defined(SO_REUSEPORT)
|
|
|
|
|
int v = 1;
|
|
|
|
|
if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &v, sizeof(int)) == -1) {
|
|
|
|
|
#ifdef SRS_CROSSBUILD
|
|
|
|
|
srs_warn("SO_REUSEPORT disabled for crossbuild");
|
|
|
|
|
return srs_success;
|
|
|
|
|
#else
|
|
|
|
|
return srs_error_new(ERROR_SOCKET_SETREUSEADDR, "SO_REUSEPORT fd=%d", fd);
|
|
|
|
|
#endif
|
|
|
|
|
srs_warn("SO_REUSEPORT failed for fd=%d", fd);
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
#warning "SO_REUSEPORT is not supported by your OS"
|
|
|
|
|