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

fix the export project bug. wakeup connection when dispose server.

This commit is contained in:
winlin 2015-06-09 14:38:05 +08:00
parent 969ed7b0ae
commit 1f1776a0d8
5 changed files with 65 additions and 17 deletions

View file

@ -88,6 +88,7 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* svr, st_netfd_t c)
duration = 0;
kbps = new SrsKbps();
kbps->set_io(skt, skt);
wakable = NULL;
mw_sleep = SRS_PERF_MW_SLEEP;
mw_enabled = false;
@ -110,6 +111,16 @@ SrsRtmpConn::~SrsRtmpConn()
srs_freep(kbps);
}
void SrsRtmpConn::dispose()
{
SrsConnection::dispose();
// wakeup the handler which need to notice.
if (wakable) {
wakable->wakeup();
}
}
// TODO: return detail message when error for client.
int SrsRtmpConn::do_cycle()
{
@ -597,7 +608,9 @@ int SrsRtmpConn::playing(SrsSource* source)
}
// delivery messages for clients playing stream.
wakable = consumer;
ret = do_playing(source, consumer, &trd);
wakable = NULL;
// stop isolate recv thread
trd.stop();