<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Dear Jeremiah,<br>
    <br>
    Thanks for sharing the code.  I think your suggestion is pretty
    close to what I want to do..  Let's see.<br>
    <br>
    I was thinking how to port my code into using live555 and it all
    boils down to this:<br>
    <br>
    Currently, I have a thread that listens to multiprocessing pipes and
    streaming sockets, i.e, in pseudo-C (select is the
    waiting-for-i/o-completion system call):<br>
    <br>
    select(pipes, sockets, timeout)<br>
    After "select" is triggered: check pipes and/or pull packets out of
    sockets, etc.<br>
    <br>
    I should do a simultaneous select call on the multiprocessing pipes
    of my own program and live555's event handling (live555 does its own
    select calls on sockets, I assume), I should do something like this:<br>
    <br>
    select(pipes, live555 event, timeout)<br>
    After select is triggered: read message from pipe and/or do a
    SingleStep() in the live555 event handling.<br>
    <br>
    To make this, I need something from live555 that tells me that a
    pending event/step has been completed .. after this I can "manually"
    do a SingleStep().<br>
    <br>
    The thing is, that doing the event loop myself, I can listen to the
    pipes at the same time.<br>
    <br>
    Any ideas on this matter are appreciated..!<br>
    <br>
    Regards,<br>
    <br>
    Sampsa<br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 17.12.2015 19:58, Jeremiah Morrill
      wrote:<br>
    </div>
    <blockquote
cite="mid:CY1PR07MB219829BC3BC59D84E031BC4F9DE00@CY1PR07MB2198.namprd07.prod.outlook.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <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>
      <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
          “<a class="moz-txt-link-freetext" href="rtsp://192.168.x.x/”">rtsp://192.168.x.x/”</a> vs “<a class="moz-txt-link-freetext" href="rtsp://my_server/”">rtsp://my_server/”</a></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 moz-do-not-send="true"
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 moz-do-not-send="true"
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 moz-do-not-send="true"
            href="http://go.microsoft.com/fwlink/?LinkId=550986">Mail</a>
          for Windows 10</p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
live-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:live-devel@lists.live555.com">live-devel@lists.live555.com</a>
<a class="moz-txt-link-freetext" href="http://lists.live555.com/mailman/listinfo/live-devel">http://lists.live555.com/mailman/listinfo/live-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>