[Live-devel] Form hang when running live555MediaServer

Jeremy Noring jnoring at logitech.com
Mon Mar 22 22:38:19 PDT 2010


On Mon, Mar 22, 2010 at 6:30 PM, steven choong <lovestoryhouse at gmail.com>wrote:

>
>
> Dear Ross,
>
> I am trying to use live555MediaServer.cpp as a server , I was successfully
> compiled the code in VS2008. I use a main form to present the
> live555MediaServer, there has a button which triggered the below functions:
>
> public:
>         void startServer(){
>
>             TaskScheduler* scheduler = BasicTaskScheduler::createNew();
>             UsageEnvironment* env =
> BasicUsageEnvironment::createNew(*scheduler);
>             UserAuthenticationDatabase* authDB = NULL;
>             RTSPServer* rtspServer;
>             portNumBits rtspServerPortNum = 554;
>             rtspServer = DynamicRTSPServer::createNew(*env,
> rtspServerPortNum, authDB);
>             if (rtspServer == NULL) {
>                 rtspServerPortNum = 8554;
>                 rtspServer = DynamicRTSPServer::createNew(*env,
> rtspServerPortNum, authDB);
>             }
>
>             env->taskScheduler().doEventLoop();
>
>         }
>
> When the form is running, user click on the button in order to start the
> server, it hangs. My question is, Is that a way to prevent the form being
> hang while the server is running ?
>
>
Unless startServer is on a thread, your doEventLoop() call will block
indefinitely.  You need to run Live555 on a dedicated thread.  Running it on
the GUI thread is not an option.  Read the FAQ section about threading if
you have questions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100322/c62b2524/attachment.html>


More information about the live-devel mailing list