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

Refine connection structure

This commit is contained in:
winlin 2020-11-04 18:15:43 +08:00
parent 7c68487bf7
commit 0a82719bd3
11 changed files with 51 additions and 37 deletions

View file

@ -68,14 +68,23 @@ public:
virtual srs_error_t cycle() = 0;
};
// Start the object, generally a croutine.
class ISrsStartable
{
public:
ISrsStartable();
virtual ~ISrsStartable();
public:
virtual srs_error_t start() = 0;
};
// The corotine object.
class SrsCoroutine
class SrsCoroutine : public ISrsStartable
{
public:
SrsCoroutine();
virtual ~SrsCoroutine();
public:
virtual srs_error_t start() = 0;
virtual void stop() = 0;
virtual void interrupt() = 0;
// @return a copy of error, which should be freed by user.