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

Refine set_recv_timeout in time unit

This commit is contained in:
winlin 2019-04-17 08:31:53 +08:00
parent 38bbf6b111
commit d3dc45f357
20 changed files with 45 additions and 46 deletions

View file

@ -84,9 +84,9 @@ public:
virtual ~ISrsProtocolReader();
// for protocol
public:
// Set the timeout tm in ms for recv bytes from peer.
// Set the timeout tm in srs_utime_t for recv bytes from peer.
// @remark Use SRS_UTIME_NO_TIMEOUT to never timeout.
virtual void set_recv_timeout(int64_t tm) = 0;
virtual void set_recv_timeout(srs_utime_t tm) = 0;
// Get the timeout in ms for recv bytes from peer.
virtual int64_t get_recv_timeout() = 0;
// For handshake.

View file

@ -304,7 +304,7 @@ void SrsProtocol::set_recv_buffer(int buffer_size)
}
#endif
void SrsProtocol::set_recv_timeout(int64_t tm)
void SrsProtocol::set_recv_timeout(srs_utime_t tm)
{
return skt->set_recv_timeout(tm);
}
@ -1815,7 +1815,7 @@ SrsRtmpClient::~SrsRtmpClient()
srs_freep(hs_bytes);
}
void SrsRtmpClient::set_recv_timeout(int64_t tm)
void SrsRtmpClient::set_recv_timeout(srs_utime_t tm)
{
protocol->set_recv_timeout(tm);
}
@ -2210,7 +2210,7 @@ void SrsRtmpServer::set_recv_buffer(int buffer_size)
}
#endif
void SrsRtmpServer::set_recv_timeout(int64_t tm)
void SrsRtmpServer::set_recv_timeout(srs_utime_t tm)
{
protocol->set_recv_timeout(tm);
}
@ -2408,7 +2408,7 @@ srs_error_t SrsRtmpServer::response_connect_app(SrsRequest *req, const char* ser
return err;
}
#define SRS_RTMP_REDIRECT_TMMS 3000
#define SRS_RTMP_REDIRECT_TMMS (3 * SRS_UTIME_SECONDS)
srs_error_t SrsRtmpServer::redirect(SrsRequest* r, string host, int port, bool& accepted)
{
srs_error_t err = srs_success;

View file

@ -304,11 +304,10 @@ public:
#endif
public:
/**
* set/get the recv timeout in ms.
* set/get the recv timeout in srs_utime_t.
* if timeout, recv/send message return ERROR_SOCKET_TIMEOUT.
*/
// TODO: FIXME: Refine tm in time unit.
virtual void set_recv_timeout(int64_t tm);
virtual void set_recv_timeout(srs_utime_t tm);
virtual int64_t get_recv_timeout();
/**
* set/get the send timeout in srs_utime_t.
@ -688,7 +687,7 @@ public:
virtual ~SrsRtmpClient();
// protocol methods proxy
public:
virtual void set_recv_timeout(int64_t tm);
virtual void set_recv_timeout(srs_utime_t tm);
virtual void set_send_timeout(srs_utime_t tm);
virtual int64_t get_recv_bytes();
virtual int64_t get_send_bytes();
@ -805,10 +804,10 @@ public:
virtual void set_recv_buffer(int buffer_size);
#endif
/**
* set/get the recv timeout in ms.
* set/get the recv timeout in srs_utime_t.
* if timeout, recv/send message return ERROR_SOCKET_TIMEOUT.
*/
virtual void set_recv_timeout(int64_t tm);
virtual void set_recv_timeout(srs_utime_t tm);
virtual int64_t get_recv_timeout();
/**
* set/get the send timeout in srs_utime_t.