Paul<br><br>thanks for your answer! <br><br>Is this behavior expected in any kind of pipes (pipe(), socketpair(), etc) ? <br><br>Iīm just starting to understand isdn and I think that do what you said isnīt so hard, after all.
<br><br>Regards<br><br>Paulo<br><br><div><span class="gmail_quote">On 2/7/07, <b class="gmail_sendername">Paul Cadach</b> &lt;<a href="mailto:paul@odt.east.telecom.kz">paul@odt.east.telecom.kz</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">






<div bgcolor="#ffffff">
<div><font face="Arial" size="2">This is expected pipe behavior (to 
split/concatenate writes following its internal rules).</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">As a workaround, you can perform quick lookup 
through message to calculate its real size (especially if you have Q.921 
headers).</font></div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><font face="Arial" size="2">WBR,</font></div><span class="sg">
<div><font face="Arial" size="2">Paul.</font></div>
</span><blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"><div><span class="e" id="q_1109ea3c810e9495_3">
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
  <div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b> 
  <a title="paulo.astdev@gmail.com" href="mailto:paulo.astdev@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Paulo 
  Garcia</a> </div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="asterisk-dev@lists.digium.com" href="mailto:asterisk-dev@lists.digium.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Asterisk Developers Mailing 
  List</a> </div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Wednesday, February 07, 2007 10:30 
  AM</div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> [asterisk-dev] Implementation 
  using libpri and socketpair()</div>
  <div><br></div>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>
  </span></div><p>
  </p><hr><span class="q">

  <p></p>_______________________________________________<br>--Bandwidth and 
  Colocation provided by <a href="http://Easynews.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Easynews.com</a> --<br><br>asterisk-dev mailing list<br>To 
  UNSUBSCRIBE or update options visit:<br>&nbsp;&nbsp; 
  <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br></span><p></p></blockquote>
</div>
<br>_______________________________________________<br>--Bandwidth and Colocation provided by <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://Easynews.com" target="_blank">Easynews.com</a> --<br><br>
asterisk-dev mailing list<br>To UNSUBSCRIBE or update options visit:<br> &nbsp; <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.digium.com/mailman/listinfo/asterisk-dev" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev
</a><br><br></blockquote></div><br>