1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #1045, revert macro for TCP keepalive detection, use system macro

This commit is contained in:
winlin 2018-01-07 17:49:14 +08:00
parent 911cd448f1
commit 366309ce2d
2 changed files with 3 additions and 5 deletions

View file

@ -223,7 +223,9 @@ int SrsTcpListener::listen()
}
srs_verbose("setsockopt reuse-addr success. port=%d, fd=%d", port, _fd);
#ifdef SRS_PERF_SO_KEEPALIVE
// Detect alive for TCP connection.
// @see https://github.com/ossrs/srs/issues/1044
#ifdef SO_KEEPALIVE
int tcp_keepalive = 1;
if (setsockopt(_fd, SOL_SOCKET, SO_KEEPALIVE, &tcp_keepalive, sizeof(int)) == -1) {
ret = ERROR_SOCKET_SETKEEPALIVE;