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

fix #194: refine the timeout recv, pulse to 500ms. 2.0.14.

This commit is contained in:
winlin 2014-11-12 12:59:53 +08:00
parent a6f3478a74
commit 8acd143a7a
4 changed files with 11 additions and 16 deletions

View file

@ -516,10 +516,7 @@ int SrsRtmpConn::playing(SrsSource* source)
SrsAutoFree(SrsConsumer, consumer);
srs_verbose("consumer created success.");
// TODO: FIXME: remove following.
rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US);
//rtmp->set_recv_timeout(ST_UTIME_NO_TIMEOUT);
//rtmp->set_send_timeout(ST_UTIME_NO_TIMEOUT);
// initialize other components
SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_PLAY_USER);
@ -531,6 +528,8 @@ int SrsRtmpConn::playing(SrsSource* source)
// collect elapse for pithy print.
pithy_print.elapse();
// read message when no data to send.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/194
// read from client.
if (true) {
SrsMessage* msg = NULL;
@ -561,13 +560,6 @@ int SrsRtmpConn::playing(SrsSource* source)
srs_error("get messages from consumer failed. ret=%d", ret);
return ret;
}
// no data, sleep a while.
// for the poll_fd maybe not active, and no message.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/194
//if (count <= 0) {
// st_usleep(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US);
//}
// reportable
if (pithy_print.can_print()) {

View file

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 13
#define VERSION_REVISION 14
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
#define RTMP_SIG_SRS_ROLE "origin/edge server"

View file

@ -67,18 +67,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// the following is the timeout for rtmp protocol,
// to avoid death connection.
// the timeout to wait client data,
// the timeout to send data to client,
// if timeout, close the connection.
#define SRS_CONSTS_RTMP_SEND_TIMEOUT_US (int64_t)(30*1000*1000LL)
// the timeout to send data to client,
// the timeout to wait client data,
// if timeout, close the connection.
#define SRS_CONSTS_RTMP_RECV_TIMEOUT_US (int64_t)(30*1000*1000LL)
// the timeout to wait for client control message,
// if timeout, we generally ignore and send the data to client,
// generally, it's the pulse time for data seding.
#define SRS_CONSTS_RTMP_PULSE_TIMEOUT_US (int64_t)(200*1000LL)
#define SRS_CONSTS_RTMP_PULSE_TIMEOUT_US (int64_t)(500*1000LL)
/**
* max rtmp header size: