<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">No, the problem is as follows. I want to get all my available contacts. To do so I send <presence /> stanza. The problem is that the script will hang here because there will be no reply from server if there are no users sharing there presence with me. In a few words I send a presence stanza and waiting for a reply which will never arrive because there are no contacts. As far as I understand PHP doesn't not support non-blocking SSL streams. <DIV>Is there a way that my presence will always return something or do I have to write everything in events and there is no other way?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>thanks,</DIV><DIV>Sergej<BR><DIV><BR><DIV>Begin forwarded message:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>From: </B></FONT><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">"Norman Rasmussen" <<A href="mailto:norman@rasmussen.co.za">norman@rasmussen.co.za</A>></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>Date: </B></FONT><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">April 20, 2007 11:15:13 AM GMT+03:00</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>To: </B></FONT><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">"Jabber software development list" <<A href="mailto:jdev@jabber.org">jdev@jabber.org</A>></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>Subject: </B></FONT><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica"><B>Re: [jdev] Is there any way to make sure that there will be a response to presence stanza</B></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT face="Helvetica" size="3" color="#000000" style="font: 12.0px Helvetica; color: #000000"><B>Reply-To: </B></FONT><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Jabber software development list <<A href="mailto:jdev@jabber.org">jdev@jabber.org</A>></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> <DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On 4/20/07, Sergej Andrejev <<A href="mailto:sandrejev@gmail.com">sandrejev@gmail.com</A>> wrote:</DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I'm writing a PHP jabber/xmpp library. So far I can connect and do</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">basic actions, but there is one problem. PHP cannot use unblocking</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">stream when working with SSL. That means when I am sending stanza I</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">must decide whether to wait for a response or not. For example when</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">sending a <message /> I am not waiting for response, but when sending</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><iq /> I do. Now when sending <presence /> I am not really sure about</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">the response and whether it will arrive or not. So if it arrives</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">everything is fine, but when not my script just hangs there waiting</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">for response. So what I am asking is that is there any type of</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><presence /> which will 100% return some data (and contacts, if there</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">are some)</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The 'standard' way of writing xmpp apps, is there's normally a central</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">loop somewhere that does the blocking receive and then the stanza is</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">dispatched to a set of event handlers.<SPAN class="Apple-converted-space"> </SPAN>Most frameworks offer the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">ability to send a stanza and ask for your callback function to be</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">executed when you receive a reply with the same id.<SPAN class="Apple-converted-space"> </SPAN>(The 'pending'</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">call goes into a list which is check when incoming stanzas are</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">received, if the id's match then the callback method is executed)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">--<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">- Norman Rasmussen</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">- Email: <A href="mailto:norman@rasmussen.co.za">norman@rasmussen.co.za</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">- Home page: <A href="http://norman.rasmussen.co.za">http://norman.rasmussen.co.za</A>/</DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>