I''m developing a network client app that requires some user interaction, so I''m trying to use EM::open_keyboard to get keyboard input. My observation is that using open_keyboard seems to interfere with the network communication. Here is roughly what I have: EM::run { # Open network connection to server. @conn = EM::connect( addr, port, Client ) @conn.odin_init( foo ) @conn.send_data( bar ) # Open a connection to get keyboard input. EM::open_keyboard( Keyboard ) } ... # Keyboard input. class Keyboard < EM::Connection def receive_data( bs ) puts "keyboard: #{bs.inspect}" end end # class Keyboard # Client connection. class Client < EM::Connection .. blah blah blah .. end As shown, the data ("bar") does not get sent to the server. If I comment out the EM::open_keyboard call, it works fine. Is there something obviously wrong with what I''m doing? Thanks, Mark Z.
On Nov 7, 2007 5:45 PM, Mark Zvilius <zvilius at earthlink.net> wrote:> I''m developing a network client app that requires some user interaction, > so I''m trying to use EM::open_keyboard to get keyboard input. My > observation is that using open_keyboard seems to interfere with the > network communication. > > Here is roughly what I have: > > EM::run { > # Open network connection to server. > @conn = EM::connect( addr, port, Client ) > @conn.odin_init( foo ) > @conn.send_data( bar ) > > # Open a connection to get keyboard input. > EM::open_keyboard( Keyboard ) > } > > ... > > # Keyboard input. > class Keyboard < EM::Connection > def receive_data( bs ) > puts "keyboard: #{bs.inspect}" > end > end # class Keyboard > > # Client connection. > class Client < EM::Connection > .. blah blah blah .. > end > > As shown, the data ("bar") does not get sent to the server. If I comment > out the EM::open_keyboard call, it works fine. Is there something > obviously wrong with what I''m doing?Are you using Windows or Linux/Mac/Unix?
Windows. On 11/7/07 5:08 PM, "Francis Cianfrocca" <garbagecat10 at gmail.com> wrote:> > Are you using Windows or Linux/Mac/Unix?-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20071107/12f677a5/attachment-0001.html