<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:505095001;
        mso-list-type:hybrid;
        mso-list-template-ids:1862182418 -1 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-text:"%1\.\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">>>I have an application that has its own event loop when manipulating/reading sockets<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So it sounds like you would like to use your event loop with the live555 library.  I have some experience here.  I was able to get libuv event loop and live555 work together.  You should be able to do the same with whatever event loop you
 are using, but it most definitely do not want to do a naïve mash-up of two event loops.  Competing event loops would just cause unneeded CPU burning or event loop blocking.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">From what I remember you will need/know:</p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="mso-list:Ignore">1.)<span style="font:7.0pt "Times New Roman"">   
</span></span><![endif]>A custom sub-class of the live555 task scheduler, eg BasicTaskScheduler?</p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="mso-list:Ignore">2.)<span style="font:7.0pt "Times New Roman"">   
</span></span><![endif]>Your own event-loop that supports a timer (execute a call-back at scheduled times).  This is to drive the live555’s “scheduledTasks”.</p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="mso-list:Ignore">3.)<span style="font:7.0pt "Times New Roman"">   
</span></span><![endif]>Event loop support for kicking up events for when a socket is read-ready, write-ready or error.  This is to drive callbacks for when sockets can be read or written to…or hit error state</p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="mso-list:Ignore">4.)<span style="font:7.0pt "Times New Roman"">   
</span></span><![endif]>Live555 already does async read-writes, so it’s best to let it execute the bsd socket code to read and write bytes</p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="mso-list:Ignore">5.)<span style="font:7.0pt "Times New Roman"">   
</span></span><![endif]>Dns resolving is still synchronous in this library, so you may want to resolve hostnames and pass the library a url such as “rtsp://192.168.x.x/” vs “rtsp://my_server/”</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have an example in the links below from a unfinished project.  Please note this code is not production ready and really just serves as an example, use at your own risk.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><a href="https://github.com/jmorrill/libuvxx/blob/master/libuvxx_rtsp/include/details/_uvxx_task_scheduler.hpp">https://github.com/jmorrill/libuvxx/blob/master/libuvxx_rtsp/include/details/_uvxx_task_scheduler.hpp</a></p>
<p class="MsoNormal"><a href="https://github.com/jmorrill/libuvxx/blob/master/libuvxx_rtsp/src/details/_uvxx_task_scheduler.cpp">https://github.com/jmorrill/libuvxx/blob/master/libuvxx_rtsp/src/details/_uvxx_task_scheduler.cpp</a></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoListParagraph"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Sent from
<a href="http://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>