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:
commit
93d3e1464a
2 changed files with 3 additions and 5 deletions
|
@ -228,7 +228,9 @@ srs_error_t SrsTcpListener::listen()
|
|||
return srs_error_new(ERROR_SOCKET_CREATE, "create socket. ip=%s, port=%d", ip.c_str(), port);
|
||||
}
|
||||
|
||||
#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) {
|
||||
return srs_error_new(ERROR_SOCKET_SETKEEPALIVE, "setsockopt SO_KEEPALIVE[%d]error. port=%d", tcp_keepalive, port);
|
||||
|
|
|
@ -190,9 +190,5 @@
|
|||
#define SRS_PERF_GLIBC_MEMORY_CHECK
|
||||
#undef SRS_PERF_GLIBC_MEMORY_CHECK
|
||||
|
||||
// Whether set SO_KEEPALIVE for TCP connection.
|
||||
// @see https://github.com/ossrs/srs/issues/1044
|
||||
#undef SRS_PERF_SO_KEEPALIVE
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue