I forgot to mention, my code is git-versioned and available on github,  
if you need more specifics:

http://github.com/elliottcable/rat/tree/fiddlesticks

The xmpp4r code is all here:
http://github.com/elliottcable/rat/tree/fiddlesticks/lib/rat/protocols/xmpp.rb


And the Ncurses code calling the xmpp4r code is here:
http://github.com/elliottcable/rat/tree/fiddlesticks/lib/rat/ncurses/window_wrapper.rb
http://github.com/elliottcable/rat/tree/fiddlesticks/lib/rat/window.rb

On Jul 21, 2008, at 11:57 PM, elliottcable wrote:

> I'm attempting to write an IM client using Ncurses and xmpp4r - I  
> understood xmpp4r was threaded and event-based, using threaded  
> callbacks for events such as message reception... but somehow,  
> Ncurses's input loop is blocking xmpp4r (or so it is as far as I can  
> tell).
>
> When I have Ncurses waiting for input (via `Ncurses::getch()`), my  
> `#add_message_callback` block (which currently, for testing  
> purposes, contains a simple `system 'say "message received"'` system  
> call) isn't being executed when I send a message from my testing  
> target to the xmpp4r client.
>
> However, when `Ncurses::getch()` cycles, I get the first of any  
> messages I've sent - and I get one more message every time it  
> cycles. I have no idea what's causing this, or blocking the thread,  
> or whatever - I'd really appreciate any help! I've been banging my  
> head against this for days now, and I'm running out of patience )-:
>
>
> *Postscript*: It's worth noting that I don't think it's the callback  
> that is the problem - I have xmpp4r debugging enabled, and there  
> doesn't appear to be any reception of stream data in between  
> `::getch` cycles. The data is actually processed as soon as it's  
> received, it is just received in a messed up one-message-per- 
> `::getch`-cycle way.
>
> ---------------------------------------------------------
>      elliott cable       _     _      +1.919.636.4204
>                         ( \---/ )
>    elliottcable.name     ) . . (    [EMAIL PROTECTED]
> ____________________,--._(___Y___)_,--.__________________
>                    `--'           `--'
> THIS MESSAGE (and any attached materials) IS INTENDED ONLY
> FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS
> ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED,
> CONFIDENTIAL, AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE
> LAW.  If you, the reader of this message, are not the
> intended recipient or the agent responsible for delivering
> the message to the intended recipient, you are hereby
> notified that any dissemination, distribution, or copying
> of this communication is strictly prohibited.  If you have
> received this communication in error, please notify me
> immediately by replying to this message and deleting all
> traces of it from your computer.  Thank you.
>                      five.sentenc.es
> _________________________________________________________
>    Signature licensed under Creative Commons BY-NC-SA 3.0
>             Do not use it, unless you follow those terms!
>


---------------------------------------------------------
       elliott cable       _     _      +1.919.636.4204
                          ( \---/ )
     elliottcable.name     ) . . (    [EMAIL PROTECTED]
____________________,--._(___Y___)_,--.__________________
                     `--'           `--'
THIS MESSAGE (and any attached materials) IS INTENDED ONLY
FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS
ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED,
CONFIDENTIAL, AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE
LAW.  If you, the reader of this message, are not the
intended recipient or the agent responsible for delivering
the message to the intended recipient, you are hereby
notified that any dissemination, distribution, or copying
of this communication is strictly prohibited.  If you have
received this communication in error, please notify me
immediately by replying to this message and deleting all
traces of it from your computer.  Thank you.
                       five.sentenc.es
_________________________________________________________
     Signature licensed under Creative Commons BY-NC-SA 3.0
              Do not use it, unless you follow those terms!


_______________________________________________
Xmpp4r-devel mailing list
Xmpp4r-devel@gna.org
https://mail.gna.org/listinfo/xmpp4r-devel

Reply via email to