Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@juntaoliu
Copy link
Contributor

No description provided.

@winlinvip
Copy link
Member

winlinvip commented Jan 7, 2018

Fix #1044 Issue of abnormal disconnection of TCP connection in live streaming pull flow end cannot be released.

TRANS_BY_GPT3

@winlinvip winlinvip merged commit a687105 into ossrs:2.0release Jan 7, 2018
}
srs_verbose("setsockopt reuse-addr success. port=%d, fd=%d", port, _fd);

#ifdef SO_KEEPALIVE
Copy link
Member

@winlinvip winlinvip Jan 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use macro definition to enable this setting? Why not always set SO_KEEPALIVE?
This macro should be undefined, so this code will not take effect, right?

TRANS_BY_GPT3

Copy link
Member

@winlinvip winlinvip Jan 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This macro is system-defined and is a reasonable way to write it.

TRANS_BY_GPT3

Copy link
Contributor Author

@juntaoliu juntaoliu Jan 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not set to open using macros, but to enhance the portability of the code. Most Unix-like systems generally define SO_KEEPALIVE in the system, so there is no problem with or without this macro judgment in such systems. However, if the code is ported to other systems, those systems may not support SO_KEEPALIVE.

TRANS_BY_GPT3

winlinvip added a commit that referenced this pull request Jan 7, 2018
@juntaoliu juntaoliu deleted the 2.0release branch January 8, 2018 02:39
@juntaoliu juntaoliu restored the 2.0release branch January 8, 2018 02:40
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TransByAI Translated by AI/GPT.

Development

Successfully merging this pull request may close these issues.

2 participants