Skip to content

Commit

Permalink
For #1045, revert macro for TCP keepalive detection, use system macro
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jan 7, 2018
1 parent 911cd44 commit 366309c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 3 additions & 1 deletion trunk/src/app/srs_app_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions trunk/src/core/srs_core_performance.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,5 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#undef 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

0 comments on commit 366309c

Please sign in to comment.