[asterisk-dev] Implementation using libpri and socketpair()

Paulo Garcia paulo.astdev at gmail.com
Wed Feb 7 17:06:09 MST 2007


Hi Moises

thank you for answer!

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.

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.

Regards!

Paulo



On 2/7/07, Moises Silva <moises.silva at gmail.com> wrote:
>
> > How can I avoid this behavior? Maybe using another way different of
> > socketpair ?
> I have not used libpri, nor completly understand how it works, but it
> seems to me that if you need just 1 message to be returned from read,
> you just need to make a wraper of read() where you just return 1
> message and put in a queue the other possibly returned message, the
> next time your app call readwrapper() return the next message on the
> queue if exists, otherwise, call the real read() again. Would this
> approach work for you?
>
> Regards
>
>
> --
> "Su nombre es GNU/Linux, no solamente Linux, mas info en
> http://www.gnu.org"
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20070207/a9fc4038/attachment.htm


More information about the asterisk-dev mailing list