mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine SrsBasicRtmpClient in time unit.
This commit is contained in:
parent
c6dcc76fea
commit
e436cc5665
10 changed files with 32 additions and 34 deletions
|
@ -33,7 +33,7 @@ using namespace std;
|
|||
#include <srs_protocol_utility.hpp>
|
||||
#include <srs_service_utility.hpp>
|
||||
|
||||
SrsBasicRtmpClient::SrsBasicRtmpClient(string u, int64_t ctm, int64_t stm)
|
||||
SrsBasicRtmpClient::SrsBasicRtmpClient(string u, srs_utime_t ctm, srs_utime_t stm)
|
||||
{
|
||||
clk = new SrsWallClock();
|
||||
kbps = new SrsKbps(clk);
|
||||
|
@ -65,7 +65,7 @@ srs_error_t SrsBasicRtmpClient::connect()
|
|||
|
||||
close();
|
||||
|
||||
transport = new SrsTcpClient(req->host, req->port, srs_utime_t(connect_timeout * SRS_UTIME_MILLISECONDS));
|
||||
transport = new SrsTcpClient(req->host, req->port, srs_utime_t(connect_timeout));
|
||||
client = new SrsRtmpClient(transport);
|
||||
kbps->set_io(transport, transport);
|
||||
|
||||
|
@ -74,8 +74,8 @@ srs_error_t SrsBasicRtmpClient::connect()
|
|||
return srs_error_wrap(err, "connect");
|
||||
}
|
||||
|
||||
client->set_recv_timeout(stream_timeout * SRS_UTIME_MILLISECONDS);
|
||||
client->set_send_timeout(stream_timeout * SRS_UTIME_MILLISECONDS);
|
||||
client->set_recv_timeout(stream_timeout);
|
||||
client->set_send_timeout(stream_timeout);
|
||||
|
||||
// connect to vhost/app
|
||||
if ((err = client->handshake()) != srs_success) {
|
||||
|
|
|
@ -50,8 +50,8 @@ class SrsBasicRtmpClient
|
|||
{
|
||||
private:
|
||||
std::string url;
|
||||
int64_t connect_timeout;
|
||||
int64_t stream_timeout;
|
||||
srs_utime_t connect_timeout;
|
||||
srs_utime_t stream_timeout;
|
||||
protected:
|
||||
SrsRequest* req;
|
||||
private:
|
||||
|
@ -63,9 +63,9 @@ private:
|
|||
public:
|
||||
// Constructor.
|
||||
// @param u The RTMP url, for example, rtmp://ip:port/app/stream?domain=vhost
|
||||
// @param ctm The timeout in ms to connect to server.
|
||||
// @param stm The timeout in ms to delivery A/V stream.
|
||||
SrsBasicRtmpClient(std::string u, int64_t ctm, int64_t stm);
|
||||
// @param ctm The timeout in srs_utime_t to connect to server.
|
||||
// @param stm The timeout in srs_utime_t to delivery A/V stream.
|
||||
SrsBasicRtmpClient(std::string u, srs_utime_t ctm, srs_utime_t stm);
|
||||
virtual ~SrsBasicRtmpClient();
|
||||
public:
|
||||
// Connect, handshake and connect app to RTMP server.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue