Hi,<br><br>in my own channel, I&#39;m implementing ISDN support using Libpri. The implementation is completely independent from zaptel then I&#39;m trying to do all communications between my hardware and libpri using socketpair function.
<br><br>The idea is to create a socketpair, passing fd[0] to pri_new function and writing to fd[1] to pass data to libpri. So far so good...<br><br>To receive data from libpri, I have a thread checking for all file descriptors fd[1] using select() function and when I receive something, I pass it to my card. This approach also works well but sometimes I receive two messages (from libpri) in only one read() call. I think this is because of libpri writes two messages so fast then when the read is called, there are already two messages in socket buffer...
<br><br>How can I avoid this behavior? Maybe using another way different of socketpair ? This communication will be used only inside the same process, between different threads.<br><br>Any path or idea will be appreciated.
<br><br><br>Regards<br><br><br>Paulo Garcia<br>