Hi Moises<br><br>thank you for answer!<br><br>As I could understand, with this approach IŽll need to interpret the packets (they have different sizes) that comes from libpri to separate them and I trying to avoid this since libpri did the "dirty" job for me.
<br><br>The "two messages together" problem only occurs when libpri send them too quickly, then I think when the read function was waked up, the socket buffer already have both packets.<br><br>Regards!<br><br>Paulo
<br><br><br><br><div><span class="gmail_quote">On 2/7/07, <b class="gmail_sendername">Moises Silva</b> <<a href="mailto:moises.silva@gmail.com">moises.silva@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> How can I avoid this behavior? Maybe using another way different of<br>> socketpair ?<br>I have not used libpri, nor completly understand how it works, but it<br>seems to me that if you need just 1 message to be returned from read,
<br>you just need to make a wraper of read() where you just return 1<br>message and put in a queue the other possibly returned message, the<br>next time your app call readwrapper() return the next message on the<br>queue if exists, otherwise, call the real read() again. Would this
<br>approach work for you?<br><br>Regards<br><br><br>--<br>"Su nombre es GNU/Linux, no solamente Linux, mas info en <a href="http://www.gnu.org">http://www.gnu.org</a>"<br>_______________________________________________
<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br><br>asterisk-dev mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev">
http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></blockquote></div><br>