mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Refine set_send_timeout in time unit
This commit is contained in:
parent
a1398892d0
commit
f4bee37e76
14 changed files with 34 additions and 34 deletions
|
@ -396,10 +396,10 @@ int64_t SimpleSocketStream::get_recv_bytes()
|
|||
}
|
||||
|
||||
// ISrsProtocolWriter
|
||||
void SimpleSocketStream::set_send_timeout(int64_t tm)
|
||||
void SimpleSocketStream::set_send_timeout(srs_utime_t tm)
|
||||
{
|
||||
srs_assert(io);
|
||||
srs_hijack_io_set_send_timeout(io, tm);
|
||||
srs_hijack_io_set_send_timeout(io, srsu2ms(tm));
|
||||
}
|
||||
|
||||
int64_t SimpleSocketStream::get_send_timeout()
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
virtual int64_t get_recv_bytes();
|
||||
// ISrsProtocolWriter
|
||||
public:
|
||||
virtual void set_send_timeout(int64_t tm);
|
||||
virtual void set_send_timeout(srs_utime_t tm);
|
||||
virtual int64_t get_send_timeout();
|
||||
virtual int64_t get_send_bytes();
|
||||
virtual srs_error_t writev(const iovec *iov, int iov_size, ssize_t* nwrite);
|
||||
|
|
|
@ -573,7 +573,7 @@ int srs_rtmp_set_timeout(srs_rtmp_t rtmp, int recv_timeout_ms, int send_timeout_
|
|||
context->rtimeout = recv_timeout_ms;
|
||||
|
||||
context->skt->set_recv_timeout(context->rtimeout);
|
||||
context->skt->set_send_timeout(context->stimeout);
|
||||
context->skt->set_send_timeout(context->stimeout * SRS_UTIME_MILLISECONDS);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ int srs_rtmp_connect_server(srs_rtmp_t rtmp)
|
|||
// set timeout if user not set.
|
||||
if (context->stimeout == SRS_UTIME_NO_TIMEOUT) {
|
||||
context->stimeout = SRS_SOCKET_DEFAULT_TMMS;
|
||||
context->skt->set_send_timeout(context->stimeout);
|
||||
context->skt->set_send_timeout(context->stimeout * SRS_UTIME_MILLISECONDS);
|
||||
}
|
||||
if (context->rtimeout == SRS_UTIME_NO_TIMEOUT) {
|
||||
context->rtimeout = SRS_SOCKET_DEFAULT_TMMS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue