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:
parent
911cd448f1
commit
366309ce2d
2 changed files with 3 additions and 5 deletions
|
@ -223,7 +223,9 @@ int SrsTcpListener::listen()
|
||||||
}
|
}
|
||||||
srs_verbose("setsockopt reuse-addr success. port=%d, fd=%d", port, _fd);
|
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;
|
int tcp_keepalive = 1;
|
||||||
if (setsockopt(_fd, SOL_SOCKET, SO_KEEPALIVE, &tcp_keepalive, sizeof(int)) == -1) {
|
if (setsockopt(_fd, SOL_SOCKET, SO_KEEPALIVE, &tcp_keepalive, sizeof(int)) == -1) {
|
||||||
ret = ERROR_SOCKET_SETKEEPALIVE;
|
ret = ERROR_SOCKET_SETKEEPALIVE;
|
||||||
|
|
|
@ -188,9 +188,5 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#undef SRS_PERF_FAST_FLV_ENCODER
|
#undef SRS_PERF_FAST_FLV_ENCODER
|
||||||
#define SRS_PERF_FAST_FLV_ENCODER
|
#define SRS_PERF_FAST_FLV_ENCODER
|
||||||
|
|
||||||
// Whether set SO_KEEPALIVE for TCP connection.
|
|
||||||
// @see https://github.com/ossrs/srs/issues/1044
|
|
||||||
#undef SRS_PERF_SO_KEEPALIVE
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue