mirror of
https://github.com/ossrs/srs.git
synced 2025-02-13 03:41:55 +00:00
Rename ISrsProtocolReaderWriter to ISrsProtocolReadWriter
This commit is contained in:
parent
6e75993e7f
commit
16fa4c588a
18 changed files with 60 additions and 60 deletions
|
@ -40,7 +40,7 @@ class SrsPublishEdge;
|
|||
class SrsRtmpClient;
|
||||
class SrsCommonMessage;
|
||||
class SrsMessageQueue;
|
||||
class ISrsProtocolReaderWriter;
|
||||
class ISrsProtocolReadWriter;
|
||||
class SrsKbps;
|
||||
class SrsLbRoundRobin;
|
||||
class SrsTcpClient;
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <srs_app_st.hpp>
|
||||
#include <srs_app_thread.hpp>
|
||||
|
||||
class ISrsProtocolReaderWriter;
|
||||
class ISrsProtocolReadWriter;
|
||||
class SrsSharedPtrMessage;
|
||||
class SrsOnMetaDataPacket;
|
||||
class SrsMessageQueue;
|
||||
|
|
|
@ -424,7 +424,7 @@ srs_error_t SimpleSocketStream::writev(const iovec *iov, int iov_size, ssize_t*
|
|||
return srs_success;
|
||||
}
|
||||
|
||||
// ISrsProtocolReaderWriter
|
||||
// ISrsProtocolReadWriter
|
||||
bool SimpleSocketStream::is_never_timeout(int64_t tm)
|
||||
{
|
||||
srs_assert(io);
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
* simple socket stream,
|
||||
* use tcp socket, sync block mode, for client like srs-librtmp.
|
||||
*/
|
||||
class SimpleSocketStream : public ISrsProtocolReaderWriter
|
||||
class SimpleSocketStream : public ISrsProtocolReadWriter
|
||||
{
|
||||
private:
|
||||
srs_hijack_io_t io;
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
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);
|
||||
// ISrsProtocolReaderWriter
|
||||
// ISrsProtocolReadWriter
|
||||
public:
|
||||
virtual bool is_never_timeout(int64_t tm);
|
||||
virtual srs_error_t read_fully(void* buf, size_t size, ssize_t* nread);
|
||||
|
|
|
@ -1193,7 +1193,7 @@ SrsKafkaApiKey SrsKafkaCorrelationPool::get(int32_t correlation_id)
|
|||
return correlation_ids[correlation_id];
|
||||
}
|
||||
|
||||
SrsKafkaProtocol::SrsKafkaProtocol(ISrsProtocolReaderWriter* io)
|
||||
SrsKafkaProtocol::SrsKafkaProtocol(ISrsProtocolReadWriter* io)
|
||||
{
|
||||
skt = io;
|
||||
reader = new SrsFastStream();
|
||||
|
@ -1310,7 +1310,7 @@ srs_error_t SrsKafkaProtocol::recv_message(SrsKafkaResponse** pmsg)
|
|||
return err;
|
||||
}
|
||||
|
||||
SrsKafkaClient::SrsKafkaClient(ISrsProtocolReaderWriter* io)
|
||||
SrsKafkaClient::SrsKafkaClient(ISrsProtocolReadWriter* io)
|
||||
{
|
||||
protocol = new SrsKafkaProtocol(io);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <srs_kernel_log.hpp>
|
||||
|
||||
class SrsFastStream;
|
||||
class ISrsProtocolReaderWriter;
|
||||
class ISrsProtocolReadWriter;
|
||||
class SrsJsonObject;
|
||||
|
||||
#ifdef SRS_AUTO_KAFKA
|
||||
|
@ -854,10 +854,10 @@ public:
|
|||
class SrsKafkaProtocol
|
||||
{
|
||||
private:
|
||||
ISrsProtocolReaderWriter* skt;
|
||||
ISrsProtocolReadWriter* skt;
|
||||
SrsFastStream* reader;
|
||||
public:
|
||||
SrsKafkaProtocol(ISrsProtocolReaderWriter* io);
|
||||
SrsKafkaProtocol(ISrsProtocolReadWriter* io);
|
||||
virtual ~SrsKafkaProtocol();
|
||||
public:
|
||||
/**
|
||||
|
@ -909,7 +909,7 @@ class SrsKafkaClient
|
|||
private:
|
||||
SrsKafkaProtocol* protocol;
|
||||
public:
|
||||
SrsKafkaClient(ISrsProtocolReaderWriter* io);
|
||||
SrsKafkaClient(ISrsProtocolReadWriter* io);
|
||||
virtual ~SrsKafkaClient();
|
||||
public:
|
||||
/**
|
||||
|
|
|
@ -47,11 +47,11 @@ ISrsProtocolWriter::~ISrsProtocolWriter()
|
|||
{
|
||||
}
|
||||
|
||||
ISrsProtocolReaderWriter::ISrsProtocolReaderWriter()
|
||||
ISrsProtocolReadWriter::ISrsProtocolReadWriter()
|
||||
{
|
||||
}
|
||||
|
||||
ISrsProtocolReaderWriter::~ISrsProtocolReaderWriter()
|
||||
ISrsProtocolReadWriter::~ISrsProtocolReadWriter()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
* / \ |
|
||||
* | |
|
||||
* +--+-----------------------------+-+
|
||||
* | IProtocolReaderWriter |
|
||||
* | IProtocolReadWriter |
|
||||
* +----------------------------------+
|
||||
* | + is_never_timeout() |
|
||||
* +----------------------------------+
|
||||
|
@ -66,7 +66,7 @@ class ISrsProtocolStatistic
|
|||
public:
|
||||
ISrsProtocolStatistic();
|
||||
virtual ~ISrsProtocolStatistic();
|
||||
// for protocol
|
||||
// for protocol
|
||||
public:
|
||||
/**
|
||||
* get the total recv bytes over underlay fd.
|
||||
|
@ -86,7 +86,7 @@ class ISrsProtocolReader : virtual public ISrsReader, virtual public ISrsProtoco
|
|||
public:
|
||||
ISrsProtocolReader();
|
||||
virtual ~ISrsProtocolReader();
|
||||
// for protocol
|
||||
// for protocol
|
||||
public:
|
||||
/**
|
||||
* Set the timeout tm in ms for recv bytes from peer.
|
||||
|
@ -97,7 +97,7 @@ public:
|
|||
* Get the timeout in ms for recv bytes from peer.
|
||||
*/
|
||||
virtual int64_t get_recv_timeout() = 0;
|
||||
// for handshake.
|
||||
// for handshake.
|
||||
public:
|
||||
/**
|
||||
* read specified size bytes of data
|
||||
|
@ -114,7 +114,7 @@ class ISrsProtocolWriter : virtual public ISrsWriter, virtual public ISrsProtoco
|
|||
public:
|
||||
ISrsProtocolWriter();
|
||||
virtual ~ISrsProtocolWriter();
|
||||
// for protocol
|
||||
// for protocol
|
||||
public:
|
||||
/**
|
||||
* Set the timeout tm in ms for send bytes to peer.
|
||||
|
@ -130,12 +130,12 @@ public:
|
|||
/**
|
||||
* the reader and writer.
|
||||
*/
|
||||
class ISrsProtocolReaderWriter : virtual public ISrsProtocolReader, virtual public ISrsProtocolWriter
|
||||
class ISrsProtocolReadWriter : virtual public ISrsProtocolReader, virtual public ISrsProtocolWriter
|
||||
{
|
||||
public:
|
||||
ISrsProtocolReaderWriter();
|
||||
virtual ~ISrsProtocolReaderWriter();
|
||||
// for protocol
|
||||
ISrsProtocolReadWriter();
|
||||
virtual ~ISrsProtocolReadWriter();
|
||||
// for protocol
|
||||
public:
|
||||
/**
|
||||
* Whether the specified tm in ms is never timeout.
|
||||
|
|
|
@ -320,7 +320,7 @@ string srs_generate_rtmp_url(string server, int port, string host, string vhost,
|
|||
return url;
|
||||
}
|
||||
|
||||
srs_error_t srs_write_large_iovs(ISrsProtocolReaderWriter* skt, iovec* iovs, int size, ssize_t* pnwrite)
|
||||
srs_error_t srs_write_large_iovs(ISrsProtocolReadWriter* skt, iovec* iovs, int size, ssize_t* pnwrite)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
class SrsMessageHeader;
|
||||
class SrsSharedPtrMessage;
|
||||
class SrsCommonMessage;
|
||||
class ISrsProtocolReaderWriter;
|
||||
class ISrsProtocolReadWriter;
|
||||
|
||||
/**
|
||||
* parse the tcUrl, output the schema, host, vhost, app and port.
|
||||
|
@ -104,7 +104,7 @@ extern void srs_parse_rtmp_url(std::string url, std::string& tcUrl, std::string&
|
|||
extern std::string srs_generate_rtmp_url(std::string server, int port, std::string host, std::string vhost, std::string app, std::string stream, std::string param);
|
||||
|
||||
// write large numbers of iovs.
|
||||
extern srs_error_t srs_write_large_iovs(ISrsProtocolReaderWriter* skt, iovec* iovs, int size, ssize_t* pnwrite = NULL);
|
||||
extern srs_error_t srs_write_large_iovs(ISrsProtocolReadWriter* skt, iovec* iovs, int size, ssize_t* pnwrite = NULL);
|
||||
|
||||
// join string in vector with indicated separator
|
||||
extern std::string srs_join_vector_string(std::vector<std::string>& vs, std::string separator);
|
||||
|
|
|
@ -1090,7 +1090,7 @@ SrsSimpleHandshake::~SrsSimpleHandshake()
|
|||
{
|
||||
}
|
||||
|
||||
srs_error_t SrsSimpleHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io)
|
||||
srs_error_t SrsSimpleHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsProtocolReadWriter* io)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -1122,7 +1122,7 @@ srs_error_t SrsSimpleHandshake::handshake_with_client(SrsHandshakeBytes* hs_byte
|
|||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsSimpleHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io)
|
||||
srs_error_t SrsSimpleHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsProtocolReadWriter* io)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -1171,7 +1171,7 @@ SrsComplexHandshake::~SrsComplexHandshake()
|
|||
{
|
||||
}
|
||||
|
||||
srs_error_t SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io)
|
||||
srs_error_t SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsProtocolReadWriter* io)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -1255,7 +1255,7 @@ srs_error_t SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* hs_byt
|
|||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io)
|
||||
srs_error_t SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsProtocolReadWriter* io)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include <srs_core.hpp>
|
||||
|
||||
class ISrsProtocolReaderWriter;
|
||||
class ISrsProtocolReadWriter;
|
||||
class SrsComplexHandshake;
|
||||
class SrsHandshakeBytes;
|
||||
class SrsBuffer;
|
||||
|
@ -511,8 +511,8 @@ public:
|
|||
/**
|
||||
* simple handshake.
|
||||
*/
|
||||
virtual srs_error_t handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io);
|
||||
virtual srs_error_t handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io);
|
||||
virtual srs_error_t handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsProtocolReadWriter* io);
|
||||
virtual srs_error_t handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsProtocolReadWriter* io);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -533,8 +533,8 @@ public:
|
|||
* try simple handshake if error is ERROR_RTMP_TRY_SIMPLE_HS,
|
||||
* otherwise, disconnect
|
||||
*/
|
||||
virtual srs_error_t handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io);
|
||||
virtual srs_error_t handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io);
|
||||
virtual srs_error_t handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsProtocolReadWriter* io);
|
||||
virtual srs_error_t handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsProtocolReadWriter* io);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -193,7 +193,7 @@ SrsProtocol::AckWindowSize::AckWindowSize()
|
|||
sequence_number = nb_recv_bytes = 0;
|
||||
}
|
||||
|
||||
SrsProtocol::SrsProtocol(ISrsProtocolReaderWriter* io)
|
||||
SrsProtocol::SrsProtocol(ISrsProtocolReadWriter* io)
|
||||
{
|
||||
in_buffer = new SrsFastStream();
|
||||
skt = io;
|
||||
|
@ -1668,7 +1668,7 @@ SrsHandshakeBytes::~SrsHandshakeBytes()
|
|||
srs_freepa(c2);
|
||||
}
|
||||
|
||||
srs_error_t SrsHandshakeBytes::read_c0c1(ISrsProtocolReaderWriter* io)
|
||||
srs_error_t SrsHandshakeBytes::read_c0c1(ISrsProtocolReadWriter* io)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -1686,7 +1686,7 @@ srs_error_t SrsHandshakeBytes::read_c0c1(ISrsProtocolReaderWriter* io)
|
|||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsHandshakeBytes::read_s0s1s2(ISrsProtocolReaderWriter* io)
|
||||
srs_error_t SrsHandshakeBytes::read_s0s1s2(ISrsProtocolReadWriter* io)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -1704,7 +1704,7 @@ srs_error_t SrsHandshakeBytes::read_s0s1s2(ISrsProtocolReaderWriter* io)
|
|||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsHandshakeBytes::read_c2(ISrsProtocolReaderWriter* io)
|
||||
srs_error_t SrsHandshakeBytes::read_c2(ISrsProtocolReadWriter* io)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -1802,7 +1802,7 @@ SrsServerInfo::SrsServerInfo()
|
|||
major = minor = revision = build = 0;
|
||||
}
|
||||
|
||||
SrsRtmpClient::SrsRtmpClient(ISrsProtocolReaderWriter* skt)
|
||||
SrsRtmpClient::SrsRtmpClient(ISrsProtocolReadWriter* skt)
|
||||
{
|
||||
io = skt;
|
||||
protocol = new SrsProtocol(skt);
|
||||
|
@ -2180,7 +2180,7 @@ srs_error_t SrsRtmpClient::fmle_publish(string stream, int& stream_id)
|
|||
return err;
|
||||
}
|
||||
|
||||
SrsRtmpServer::SrsRtmpServer(ISrsProtocolReaderWriter* skt)
|
||||
SrsRtmpServer::SrsRtmpServer(ISrsProtocolReadWriter* skt)
|
||||
{
|
||||
io = skt;
|
||||
protocol = new SrsProtocol(skt);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <srs_core_performance.hpp>
|
||||
#include <srs_kernel_flv.hpp>
|
||||
|
||||
class ISrsProtocolReaderWriter;
|
||||
class ISrsProtocolReadWriter;
|
||||
class SrsFastStream;
|
||||
class SrsPacket;
|
||||
class SrsBuffer;
|
||||
|
@ -54,7 +54,7 @@ class SrsSharedPtrMessage;
|
|||
class IMergeReadHandler;
|
||||
|
||||
class SrsProtocol;
|
||||
class ISrsProtocolReaderWriter;
|
||||
class ISrsProtocolReadWriter;
|
||||
class SrsCommonMessage;
|
||||
class SrsCreateStreamPacket;
|
||||
class SrsFMLEStartPacket;
|
||||
|
@ -200,7 +200,7 @@ private:
|
|||
/**
|
||||
* underlayer socket object, send/recv bytes.
|
||||
*/
|
||||
ISrsProtocolReaderWriter* skt;
|
||||
ISrsProtocolReadWriter* skt;
|
||||
/**
|
||||
* requests sent out, used to build the response.
|
||||
* key: transactionId
|
||||
|
@ -272,7 +272,7 @@ private:
|
|||
*/
|
||||
int32_t out_chunk_size;
|
||||
public:
|
||||
SrsProtocol(ISrsProtocolReaderWriter* io);
|
||||
SrsProtocol(ISrsProtocolReadWriter* io);
|
||||
virtual ~SrsProtocol();
|
||||
public:
|
||||
/**
|
||||
|
@ -653,9 +653,9 @@ public:
|
|||
SrsHandshakeBytes();
|
||||
virtual ~SrsHandshakeBytes();
|
||||
public:
|
||||
virtual srs_error_t read_c0c1(ISrsProtocolReaderWriter* io);
|
||||
virtual srs_error_t read_s0s1s2(ISrsProtocolReaderWriter* io);
|
||||
virtual srs_error_t read_c2(ISrsProtocolReaderWriter* io);
|
||||
virtual srs_error_t read_c0c1(ISrsProtocolReadWriter* io);
|
||||
virtual srs_error_t read_s0s1s2(ISrsProtocolReadWriter* io);
|
||||
virtual srs_error_t read_c2(ISrsProtocolReadWriter* io);
|
||||
virtual srs_error_t create_c0c1();
|
||||
virtual srs_error_t create_s0s1s2(const char* c1 = NULL);
|
||||
virtual srs_error_t create_c2();
|
||||
|
@ -687,9 +687,9 @@ private:
|
|||
SrsHandshakeBytes* hs_bytes;
|
||||
protected:
|
||||
SrsProtocol* protocol;
|
||||
ISrsProtocolReaderWriter* io;
|
||||
ISrsProtocolReadWriter* io;
|
||||
public:
|
||||
SrsRtmpClient(ISrsProtocolReaderWriter* skt);
|
||||
SrsRtmpClient(ISrsProtocolReadWriter* skt);
|
||||
virtual ~SrsRtmpClient();
|
||||
// protocol methods proxy
|
||||
public:
|
||||
|
@ -778,9 +778,9 @@ class SrsRtmpServer
|
|||
private:
|
||||
SrsHandshakeBytes* hs_bytes;
|
||||
SrsProtocol* protocol;
|
||||
ISrsProtocolReaderWriter* io;
|
||||
ISrsProtocolReadWriter* io;
|
||||
public:
|
||||
SrsRtmpServer(ISrsProtocolReaderWriter* skt);
|
||||
SrsRtmpServer(ISrsProtocolReadWriter* skt);
|
||||
virtual ~SrsRtmpServer();
|
||||
// protocol methods proxy
|
||||
public:
|
||||
|
|
|
@ -811,7 +811,7 @@ srs_error_t SrsRtspSetupResponse::encode_header(stringstream& ss)
|
|||
return srs_success;
|
||||
}
|
||||
|
||||
SrsRtspStack::SrsRtspStack(ISrsProtocolReaderWriter* s)
|
||||
SrsRtspStack::SrsRtspStack(ISrsProtocolReadWriter* s)
|
||||
{
|
||||
buf = new SrsSimpleStream();
|
||||
skt = s;
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
class SrsBuffer;
|
||||
class SrsSimpleStream;
|
||||
class SrsAudioFrame;
|
||||
class ISrsProtocolReaderWriter;
|
||||
class ISrsProtocolReadWriter;
|
||||
|
||||
// rtsp specification
|
||||
// CR = <US-ASCII CR, carriage return (13)>
|
||||
|
@ -657,9 +657,9 @@ private:
|
|||
/**
|
||||
* underlayer socket object, send/recv bytes.
|
||||
*/
|
||||
ISrsProtocolReaderWriter* skt;
|
||||
ISrsProtocolReadWriter* skt;
|
||||
public:
|
||||
SrsRtspStack(ISrsProtocolReaderWriter* s);
|
||||
SrsRtspStack(ISrsProtocolReadWriter* s);
|
||||
virtual ~SrsRtspStack();
|
||||
public:
|
||||
/**
|
||||
|
|
|
@ -109,7 +109,7 @@ public:
|
|||
* the socket provides TCP socket over st,
|
||||
* that is, the sync socket mechanism.
|
||||
*/
|
||||
class SrsStSocket : public ISrsProtocolReaderWriter
|
||||
class SrsStSocket : public ISrsProtocolReadWriter
|
||||
{
|
||||
private:
|
||||
// The recv/send timeout in ms.
|
||||
|
@ -158,7 +158,7 @@ public:
|
|||
* client.read(buf, 4096, NULL);
|
||||
* @remark User can directly free the object, which will close the fd.
|
||||
*/
|
||||
class SrsTcpClient : public ISrsProtocolReaderWriter
|
||||
class SrsTcpClient : public ISrsProtocolReadWriter
|
||||
{
|
||||
private:
|
||||
srs_netfd_t stfd;
|
||||
|
@ -189,7 +189,7 @@ private:
|
|||
* @remark User should never use the client when close it.
|
||||
*/
|
||||
virtual void close();
|
||||
// interface ISrsProtocolReaderWriter
|
||||
// interface ISrsProtocolReadWriter
|
||||
public:
|
||||
virtual bool is_never_timeout(int64_t tm);
|
||||
virtual void set_recv_timeout(int64_t tm);
|
||||
|
|
|
@ -40,7 +40,7 @@ using namespace _srs_internal;
|
|||
|
||||
#include <srs_protocol_io.hpp>
|
||||
|
||||
class MockEmptyIO : public ISrsProtocolReaderWriter
|
||||
class MockEmptyIO : public ISrsProtocolReadWriter
|
||||
{
|
||||
public:
|
||||
MockEmptyIO();
|
||||
|
@ -68,7 +68,7 @@ public:
|
|||
virtual srs_error_t read(void* buf, size_t size, ssize_t* nread);
|
||||
};
|
||||
|
||||
class MockBufferIO : public ISrsProtocolReaderWriter
|
||||
class MockBufferIO : public ISrsProtocolReadWriter
|
||||
{
|
||||
public:
|
||||
// The send/recv timeout in ms.
|
||||
|
|
Loading…
Reference in a new issue