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

For #906, #902, use coroutine for one cycle thread

This commit is contained in:
winlin 2017-05-29 19:45:19 +08:00
parent b21f92f97a
commit 2ed2513f08
11 changed files with 44 additions and 212 deletions

View file

@ -195,7 +195,7 @@ SrsRtspConn::SrsRtspConn(SrsRtspCaster* c, st_netfd_t fd, std::string o)
stfd = fd;
skt = new SrsStSocket();
rtsp = new SrsRtspStack(skt);
trd = new SrsOneCycleThread("rtsp", this);
trd = new SrsCoroutine("rtsp", this);
req = NULL;
sdk = NULL;
@ -249,7 +249,7 @@ int SrsRtspConn::do_cycle()
srs_trace("rtsp: serve %s", ip.c_str());
// consume all rtsp messages.
for (;;) {
while (!trd->pull()) {
SrsRtspRequest* req = NULL;
if ((ret = rtsp->recv_message(&req)) != ERROR_SUCCESS) {
if (!srs_is_client_gracefully_close(ret)) {