On Mon, Mar 22, 2010 at 6:30 PM, steven choong <span dir="ltr"><<a href="mailto:lovestoryhouse@gmail.com">lovestoryhouse@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br><div class="gmail_quote"><div><div><br><div class="gmail_quote"><div class="gmail_quote">Dear Ross,<br><br>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:<br>
<br>public:<br> void startServer(){<br><br> TaskScheduler* scheduler = BasicTaskScheduler::createNew();<br> UsageEnvironment* env = BasicUsageEnvironment::createNew(*scheduler);<br> UserAuthenticationDatabase* authDB = NULL;<br>
RTSPServer* rtspServer;<br> portNumBits rtspServerPortNum = 554;<br> rtspServer = DynamicRTSPServer::createNew(*env, rtspServerPortNum, authDB);<br> if (rtspServer == NULL) {<br>
rtspServerPortNum = 8554;<br> rtspServer = DynamicRTSPServer::createNew(*env, rtspServerPortNum, authDB);<br> }<br> <br> env->taskScheduler().doEventLoop();<br>
<br> }<br><br>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 ?<br><br>
</div></div></div></div></div></blockquote><div><br>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. </div>
</div>