This commit is contained in:
Doubango Telecom 2016-08-02 16:31:08 +02:00
commit 6f5bd675fd
2 changed files with 29 additions and 29 deletions

View File

@ -11,7 +11,7 @@ sudo yum install make libtool autoconf subversion git wget libogg-devel gcc gcc-
The first step is to checkout Doubango 2.0 source code: The first step is to checkout Doubango 2.0 source code:
``` ```
svn checkout https://doubango.googlecode.com/svn/branches/2.0/doubango doubango git clone https://github.com/DoubangoTelecom/doubango.git
``` ```
### Building libsrtp ### ### Building libsrtp ###
@ -188,7 +188,7 @@ make && make install
``` ```
git clone https://github.com/cisco/openh264.git git clone https://github.com/cisco/openh264.git
cd openh264 cd openh264
git checkout v1.1 git checkout v1.5.0
make ENABLE64BIT=Yes # Use ENABLE64BIT=No for 32bit platforms make ENABLE64BIT=Yes # Use ENABLE64BIT=No for 32bit platforms
make install make install
``` ```

View File

@ -644,8 +644,10 @@ int removeSocketAtIndex(int index, transport_context_t *context)
tnet_fd_t fd = sock->fd; tnet_fd_t fd = sock->fd;
// Remove from runloop // Remove from runloop
if (context->cf_run_loop && sock->cf_run_loop_source) { if (sock->cf_run_loop_source) {
if (context->cf_run_loop) {
CFRunLoopRemoveSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopCommonModes); CFRunLoopRemoveSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopCommonModes);
}
CFRelease(sock->cf_run_loop_source), sock->cf_run_loop_source = NULL; CFRelease(sock->cf_run_loop_source), sock->cf_run_loop_source = NULL;
} }
@ -1299,6 +1301,10 @@ void *tnet_transport_mainthread(void *param)
} }
} }
bail:
TSK_DEBUG_INFO("Stopped [%s] server with IP {%s} on port {%d}...", transport->description, transport->master->ip, transport->master->port);
if(context->cf_run_loop) {
// Remove all the sockets, streams and sources from the run loop // Remove all the sockets, streams and sources from the run loop
tsk_safeobj_lock(context); tsk_safeobj_lock(context);
for(i = 0; i < context->count; i++) { for(i = 0; i < context->count; i++) {
@ -1312,20 +1318,14 @@ void *tnet_transport_mainthread(void *param)
CFRunLoopRemoveSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopDefaultMode); CFRunLoopRemoveSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopDefaultMode);
} }
if (sock->cf_read_stream) { if (sock->cf_read_stream) {
//CFReadStreamClose(sock->cf_read_stream);
CFReadStreamUnscheduleFromRunLoop(sock->cf_read_stream, context->cf_run_loop, kCFRunLoopDefaultMode); CFReadStreamUnscheduleFromRunLoop(sock->cf_read_stream, context->cf_run_loop, kCFRunLoopDefaultMode);
} }
if (sock->cf_write_stream) { if (sock->cf_write_stream) {
//CFWriteStreamClose(sock->cf_write_stream);
CFWriteStreamUnscheduleFromRunLoop(sock->cf_write_stream, context->cf_run_loop, kCFRunLoopDefaultMode); CFWriteStreamUnscheduleFromRunLoop(sock->cf_write_stream, context->cf_run_loop, kCFRunLoopDefaultMode);
} }
} }
tsk_safeobj_unlock(context); tsk_safeobj_unlock(context);
// Release context
bail:
TSK_DEBUG_INFO("Stopped [%s] server with IP {%s} on port {%d}...", transport->description, transport->master->ip, transport->master->port);
if(context->cf_run_loop) {
CFRelease(context->cf_run_loop); CFRelease(context->cf_run_loop);
context->cf_run_loop = NULL; context->cf_run_loop = NULL;
} }