go into the C code and disable it :) On Tue, Apr 22, 2008 at 7:02 PM, <eventmachine-talk-request at rubyforge.org> wrote:> Send Eventmachine-talk mailing list submissions to > eventmachine-talk at rubyforge.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://rubyforge.org/mailman/listinfo/eventmachine-talk > or, via email, send a message with subject or body ''help'' to > eventmachine-talk-request at rubyforge.org > > You can reach the person managing the list at > eventmachine-talk-owner at rubyforge.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Eventmachine-talk digest..." > > > Today''s Topics: > > 1. EM outbound message pacing: howto? (Mark Van De Vyver) > 2. Adding regular updates for long server calls > (Benjamin Brinckerhoff) > 3. Using Ruby''s OpenSSL bindings with EM (Jos Backus) > 4. Re: Using Ruby''s OpenSSL bindings with EM (Michael S. Fischer) > 5. Re: Using Ruby''s OpenSSL bindings with EM (Jason Roelofs) > 6. unbind trouble (Seth Bollinger) > 7. run_block terminates all event descriptors ? (Bill Kelly) > 8. Re: run_block terminates all event descriptors ? (Bill Kelly) > 9. stoopid n00b questions (Jeff Fedor) > 10. Re: stoopid n00b questions (Bill Kelly) > 11. Re: stoopid n00b questions (Jeff Fedor) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 6 Apr 2008 11:54:55 +1100 > From: "Mark Van De Vyver" <mvyver at gmail.com> > Subject: [Eventmachine-talk] EM outbound message pacing: howto? > To: EM-talk <eventmachine-talk at rubyforge.org> > Message-ID: > <389c43e40804051754n69551761mbb18f1299f0095ef at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Group, > I''d like to be able to set a pacing behavior on outbound messages, in > this case one call of send_data is a message. > Two scenarios come to mind. > a) send_data with some fixed time interval between calls, send_data > data is queued if more calls are made than can be ''allowed''/processed > b) send_data freely until some max_count during an interval is > reached, then queue messages until the end of the interval and resume > sending the queued messages. > > - From what I''ve seen neither of these behavior are configurable > (already implemented) in EM - correct? > > Could anyone indicate what methods I might look at to implement these, > that will at least give me a starting point to work from. > Is there an existing project/example that implements a) or b) which I > should look at? > > Cheers > Mark > > > ------------------------------ > > Message: 2 > Date: Sun, 6 Apr 2008 23:59:15 -0600 > From: "Benjamin Brinckerhoff" <bhbrinckerhoff at wustl.edu> > Subject: [Eventmachine-talk] Adding regular updates for long server > calls > To: eventmachine-talk at rubyforge.org > Message-ID: > <205841880804062259p2b0cf3amf5fd56d6ee75ede1 at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > All, > > I''m working on my first EM application, and I''m stuck. My client calls > the server, which executes a long-running operation. I would like the > server to be able to send data back to the client as the job executes, > but right now all the data send to send_data is buffered up and sent > when the job is complete. I''ve Googled for solutions and have seen an > answer using EM.next_tick, but this did not work for me. Also, I > noticed in the document SPAWNED_PROCESSES it mentioned that spawned > processes can be used to solve this problem, but I have not yet found > an example. Here is a simplified version of my code > > ====== server ======> require ''eventmachine'' > > class ExampleServer < EventMachine::Connection > > def receive_data(data) > do_job > end > > def do_job > (1..10).each do |i| > send_data "." # I want this data to be sent > back to the client before each call to long_operation > long_operation > end > send_done > end > > def long_operation > # something that takes awhile > end > > def send_done > send_data "done" > end > > end > > EventMachine::run { > EventMachine::start_server "192.168.1.101", 7777, ExampleServer > } > ====== client =====> require ''eventmachine'' > > class ExampleClient < EventMachine::Connection > > def receive_data(data) > puts data > end > > end > > EventMachine::run { > EventMachine::connect "192.168.1.101", 7777, ExampleClient do |c| > c.send_data "go" > end > } > ==============> > Thanks in advance for any help you can provide. > > Ben > > > ------------------------------ > > Message: 3 > Date: Thu, 10 Apr 2008 00:00:06 -0700 > From: Jos Backus <jos at catnook.com> > Subject: [Eventmachine-talk] Using Ruby''s OpenSSL bindings with EM > To: eventmachine-talk at rubyforge.org > Message-ID: <20080410070006.GA12858 at lizzy.catnook.local> > Content-Type: text/plain; charset=us-ascii > > How hard would it be to use the Ruby OpenSSL bindings from within > Eventmachine? I''d like to expose the client cert received by the server to > Ruby using functions that are defined in ossl_x509cert.c which is part of > Ruby''s OpenSSL bindings. (This is part of an effort to make Swiftiply work > with Puppet.) > > I have hacked ssl.cpp to the point where I have SSL_VERIFY_PEER working (so > the client is asked to send a cert and I can call X509_get_subject_name() on > the cert). Now I''d like to pass the *X509 cert handle to something like > ossl_x509_new(X509 *x509) which returns a Ruby VALUE, which in turn could then > be exposed through Eventmachine''s SslBox class (somehow). > > Any suggestions would be most welcome. > > -- > Jos Backus > jos at catnook.com > > > ------------------------------ > > Message: 4 > Date: Thu, 10 Apr 2008 08:09:00 -0700 > From: "Michael S. Fischer" <michael at dynamine.net> > Subject: Re: [Eventmachine-talk] Using Ruby''s OpenSSL bindings with EM > To: jos at catnook.com, eventmachine-talk at rubyforge.org > Message-ID: > <86db848d0804100809j6055686at14085ad662a30fbe at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > I''ve been asking for peer verification for months. Here''s hoping it > finally gets in! > > --Michael > > On Thu, Apr 10, 2008 at 12:00 AM, Jos Backus <jos at catnook.com> wrote: > > How hard would it be to use the Ruby OpenSSL bindings from within > > Eventmachine? I''d like to expose the client cert received by the server to > > Ruby using functions that are defined in ossl_x509cert.c which is part of > > Ruby''s OpenSSL bindings. (This is part of an effort to make Swiftiply work > > with Puppet.) > > > > I have hacked ssl.cpp to the point where I have SSL_VERIFY_PEER working (so > > the client is asked to send a cert and I can call X509_get_subject_name() on > > the cert). Now I''d like to pass the *X509 cert handle to something like > > ossl_x509_new(X509 *x509) which returns a Ruby VALUE, which in turn could then > > be exposed through Eventmachine''s SslBox class (somehow). > > > > Any suggestions would be most welcome. > > > > -- > > Jos Backus > > jos at catnook.com > > _______________________________________________ > > Eventmachine-talk mailing list > > Eventmachine-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > > > > ------------------------------ > > Message: 5 > Date: Thu, 10 Apr 2008 11:16:12 -0400 > From: "Jason Roelofs" <jameskilton at gmail.com> > Subject: Re: [Eventmachine-talk] Using Ruby''s OpenSSL bindings with EM > To: eventmachine-talk at rubyforge.org > Message-ID: > <e078f4ba0804100816l740e6827h51899e76c649bf4d at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > I would suggest opening up a ticket at rubyeventmachine.com to make > sure that this request doesn''t get lost. > > Jason > > On Thu, Apr 10, 2008 at 11:09 AM, Michael S. Fischer > <michael at dynamine.net> wrote: > > I''ve been asking for peer verification for months. Here''s hoping it > > finally gets in! > > > > --Michael > > > > > > > > On Thu, Apr 10, 2008 at 12:00 AM, Jos Backus <jos at catnook.com> wrote: > > > How hard would it be to use the Ruby OpenSSL bindings from within > > > Eventmachine? I''d like to expose the client cert received by the server to > > > Ruby using functions that are defined in ossl_x509cert.c which is part of > > > Ruby''s OpenSSL bindings. (This is part of an effort to make Swiftiply work > > > with Puppet.) > > > > > > I have hacked ssl.cpp to the point where I have SSL_VERIFY_PEER working (so > > > the client is asked to send a cert and I can call X509_get_subject_name() on > > > the cert). Now I''d like to pass the *X509 cert handle to something like > > > ossl_x509_new(X509 *x509) which returns a Ruby VALUE, which in turn could then > > > be exposed through Eventmachine''s SslBox class (somehow). > > > > > > Any suggestions would be most welcome. > > > > > > -- > > > Jos Backus > > > jos at catnook.com > > > _______________________________________________ > > > Eventmachine-talk mailing list > > > Eventmachine-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > > > > > _______________________________________________ > > Eventmachine-talk mailing list > > Eventmachine-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > > ------------------------------ > > Message: 6 > Date: Fri, 11 Apr 2008 19:58:20 -0500 > From: Seth Bollinger <seth_bollinger at comcast.net> > Subject: [Eventmachine-talk] unbind trouble > To: mailto: eventmachine-talk at rubyforge.org > Message-ID: <20080412005820.GA11447 at hyperion.digi.com> > Content-Type: text/plain; charset=us-ascii > > Hello All, > > I''m having trouble detecting when a client terminates a tcp connection to my > server. > > If I define unbind, I see the following exception raised. > > /usr/lib64/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/eventmachine.rb:1071:in `event_callback'': > EventMachine::ConnectionNotBound (EventMachine::ConnectionNotBound) > from /usr/lib64/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/eventmachine.rb:226:in > `release_machine'' > from /usr/lib64/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/eventmachine.rb:226:in `run'' > from ./order_daemon.rb:355:in `run'' > from ./order_daemon.rb:373 > > I''ve added begin/rescue to all of my procedures, and I''m certain there''s not > an error in my code. > > If I don''t define unbind, the server connection will continue on it''s merry > way. > > It might be worth mentioning that I''m using an ssl socket. > > Also, when you add a periodic timer using the add_periodic_timer method, there > doesn''t seem to be a way to kill the timer. It will keep running even if you > return the value specified in the add_periodic_timer method (the examples all > show nil, this didn''t work). > > Thanks, > > Seth > > > > ------------------------------ > > Message: 7 > Date: Thu, 17 Apr 2008 01:43:21 -0700 > From: "Bill Kelly" <billk at cts.com> > Subject: [Eventmachine-talk] run_block terminates all event > descriptors ? > To: <eventmachine-talk at rubyforge.org> > Message-ID: <11ab01c8a067$17f42110$6442a8c0 at gonzo> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > reply-type=original > > Hi, > > Is EventMachine.run_block intended to close socket connections and > terminate timer events, etc., at the end of the block? > > I''m using EM from svn trunk, at revision 674. (head) > > On ruby 1.8.4 (2005-12-24) [i386-mswin32]. > > > I had been hoping to use run_block to facilitate my unit testing, > proceeding linearly through a test case, using run_block to crank > the machine as needed until some state changed, then do some > asserts, repeat. . . > > But it seems that at the end of the block executed by run_block, > all my connections unbind. > > Is this the intended behavior? > > > Regards, > > Bill > > > > > ------------------------------ > > Message: 8 > Date: Thu, 17 Apr 2008 01:55:40 -0700 > From: "Bill Kelly" <billk at cts.com> > Subject: Re: [Eventmachine-talk] run_block terminates all event > descriptors ? > To: <eventmachine-talk at rubyforge.org> > Message-ID: <11b801c8a068$d043b400$6442a8c0 at gonzo> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > reply-type=original > > > From: "Bill Kelly" <billk at cts.com> > > > > But it seems that at the end of the block executed by run_block, > > all my connections unbind. > > > > Is this the intended behavior? > > Errr... sorry, I see that is indeed the documented behavior of > EventMachine::stop_event_loop. > > > Hummmm... OK, I guess I''ll do my unit tests a different way. :) > > > Regards, > > Bill > > > > > ------------------------------ > > Message: 9 > Date: Tue, 22 Apr 2008 11:12:36 -0400 > From: "Jeff Fedor" <jeff.fedor at gmail.com> > Subject: [Eventmachine-talk] stoopid n00b questions > To: eventmachine-talk at rubyforge.org > Message-ID: > <7d7027660804220812i357bb60t331ee1e931ef247 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > New to EventMachine and Ruby so perfect storm of newbieness. So apologies in > advance... > > I checked the docs and list archives but came up empty handed on the > following: > > So dumb question #1. Is there a way to get the IP address & Port of a > running EventMachine? > > Dumb question #1 part 2: can you issue a EventMachine::start_server command > and have it grab the next available port similar to the way TCPServer > behaves? Note, I''m not lazy just don''t know how to grab the IP & Port. N00b > remember > > thanks in advance > j > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080422/a9da0cbf/attachment-0001.html > > ------------------------------ > > Message: 10 > Date: Tue, 22 Apr 2008 17:06:58 -0700 > From: "Bill Kelly" <billk at cts.com> > Subject: Re: [Eventmachine-talk] stoopid n00b questions > To: <eventmachine-talk at rubyforge.org> > Message-ID: <04ce01c8a4d5$f2f23cd0$6442a8c0 at gonzo> > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > reply-type=original > > > From: Jeff Fedor > > > > question #1. Is there a way to get the IP address & Port of a running > > EventMachine? > > One can obtain the IP and port of a connected TCP peer like: > > require ''eventmachine'' > require ''socket'' > > interface_ip = "0.0.0.0" > port = 12345 > > EventMachine::start_server(interface_ip, port, EventMachine::Connection) do |client_connection| > > remote_port, remote_ip = Socket.unpack_sockaddr_in(client_connection.get_peername) > > end > > > > question #1 part 2: can you issue a EventMachine::start_server > > command and have it grab the next available port similar to the way > > TCPServer behaves? Note, I''m not lazy just don''t know how to grab the > > IP & Port. > > Except in rare cases, when one starts a server, one provides > a known port number that one expects clients to know about and > be connecting to. > > The IP address provided to start_server is an indication of which > interface to bind to. Generally one either specifices "0.0.0.0", > meaning accept local and external connections, or "127.0.0.1", > meaning accept only local connections. > > > Hope this helps, > > Bill > > > > > > > ------------------------------ > > Message: 11 > Date: Tue, 22 Apr 2008 21:02:25 -0400 > From: "Jeff Fedor" <jeff.fedor at gmail.com> > Subject: Re: [Eventmachine-talk] stoopid n00b questions > To: eventmachine-talk at rubyforge.org > Message-ID: > <7d7027660804221802i7d8a07c4r313fe83d752f70c8 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Thanks Bill. I was hoping to be able to spark up EventMachines on the next > available port on the fly but sounds like I''m an edge case > > appreciate the help > j > > On Tue, Apr 22, 2008 at 8:06 PM, Bill Kelly <billk at cts.com> wrote: > > > > > From: Jeff Fedor > > > > > > > question #1. Is there a way to get the IP address & Port of a running > > > EventMachine? > > > > One can obtain the IP and port of a connected TCP peer like: > > > > require ''eventmachine'' > > require ''socket'' > > > > interface_ip = "0.0.0.0" > > port = 12345 > > > > EventMachine::start_server(interface_ip, port, EventMachine::Connection) > > do |client_connection| > > > > remote_port, remote_ip > > Socket.unpack_sockaddr_in(client_connection.get_peername) > > > > end > > > > > > > question #1 part 2: can you issue a EventMachine::start_server > > > command and have it grab the next available port similar to the way > > > TCPServer behaves? Note, I''m not lazy just don''t know how to grab the > > > IP & Port. > > > > Except in rare cases, when one starts a server, one provides > > a known port number that one expects clients to know about and > > be connecting to. > > > > The IP address provided to start_server is an indication of which > > interface to bind to. Generally one either specifices "0.0.0.0", > > meaning accept local and external connections, or "127.0.0.1", > > meaning accept only local connections. > > > > > > Hope this helps, > > > > Bill > > > > > > > > > > _______________________________________________ > > Eventmachine-talk mailing list > > Eventmachine-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080422/a0341564/attachment.html > > ------------------------------ > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > End of Eventmachine-talk Digest, Vol 24, Issue 2 > ************************************************ >
Out of curiosity, what would be the point of re-enabling the nagle algorithm? It''s disabled for a reason. On Mon, Apr 28, 2008 at 8:16 PM, Roger Pack <rogerpack2005 at gmail.com> wrote:> go into the C code and disable it :) > > On Tue, Apr 22, 2008 at 7:02 PM, > <eventmachine-talk-request at rubyforge.org> wrote: > > Send Eventmachine-talk mailing list submissions to > > eventmachine-talk at rubyforge.org > > > > To subscribe or unsubscribe via the World Wide Web, visit > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > or, via email, send a message with subject or body ''help'' to > > eventmachine-talk-request at rubyforge.org > > > > You can reach the person managing the list at > > eventmachine-talk-owner at rubyforge.org > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of Eventmachine-talk digest..." > > > > > > Today''s Topics: > > > > 1. EM outbound message pacing: howto? (Mark Van De Vyver) > > 2. Adding regular updates for long server calls > > (Benjamin Brinckerhoff) > > 3. Using Ruby''s OpenSSL bindings with EM (Jos Backus) > > 4. Re: Using Ruby''s OpenSSL bindings with EM (Michael S. Fischer) > > 5. Re: Using Ruby''s OpenSSL bindings with EM (Jason Roelofs) > > 6. unbind trouble (Seth Bollinger) > > 7. run_block terminates all event descriptors ? (Bill Kelly) > > 8. Re: run_block terminates all event descriptors ? (Bill Kelly) > > 9. stoopid n00b questions (Jeff Fedor) > > 10. Re: stoopid n00b questions (Bill Kelly) > > 11. Re: stoopid n00b questions (Jeff Fedor) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Sun, 6 Apr 2008 11:54:55 +1100 > > From: "Mark Van De Vyver" <mvyver at gmail.com> > > Subject: [Eventmachine-talk] EM outbound message pacing: howto? > > To: EM-talk <eventmachine-talk at rubyforge.org> > > Message-ID: > > <389c43e40804051754n69551761mbb18f1299f0095ef at mail.gmail.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > Hi Group, > > I''d like to be able to set a pacing behavior on outbound messages, in > > this case one call of send_data is a message. > > Two scenarios come to mind. > > a) send_data with some fixed time interval between calls, send_data > > data is queued if more calls are made than can be ''allowed''/processed > > b) send_data freely until some max_count during an interval is > > reached, then queue messages until the end of the interval and resume > > sending the queued messages. > > > > - From what I''ve seen neither of these behavior are configurable > > (already implemented) in EM - correct? > > > > Could anyone indicate what methods I might look at to implement these, > > that will at least give me a starting point to work from. > > Is there an existing project/example that implements a) or b) which I > > should look at? > > > > Cheers > > Mark > > > > > > ------------------------------ > > > > Message: 2 > > Date: Sun, 6 Apr 2008 23:59:15 -0600 > > From: "Benjamin Brinckerhoff" <bhbrinckerhoff at wustl.edu> > > Subject: [Eventmachine-talk] Adding regular updates for long server > > calls > > To: eventmachine-talk at rubyforge.org > > Message-ID: > > <205841880804062259p2b0cf3amf5fd56d6ee75ede1 at mail.gmail.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > All, > > > > I''m working on my first EM application, and I''m stuck. My client calls > > the server, which executes a long-running operation. I would like the > > server to be able to send data back to the client as the job executes, > > but right now all the data send to send_data is buffered up and sent > > when the job is complete. I''ve Googled for solutions and have seen an > > answer using EM.next_tick, but this did not work for me. Also, I > > noticed in the document SPAWNED_PROCESSES it mentioned that spawned > > processes can be used to solve this problem, but I have not yet found > > an example. Here is a simplified version of my code > > > > ====== server ======> > require ''eventmachine'' > > > > class ExampleServer < EventMachine::Connection > > > > def receive_data(data) > > do_job > > end > > > > def do_job > > (1..10).each do |i| > > send_data "." # I want this data to be sent > > back to the client before each call to long_operation > > long_operation > > end > > send_done > > end > > > > def long_operation > > # something that takes awhile > > end > > > > def send_done > > send_data "done" > > end > > > > end > > > > EventMachine::run { > > EventMachine::start_server "192.168.1.101", 7777, ExampleServer > > } > > ====== client =====> > require ''eventmachine'' > > > > class ExampleClient < EventMachine::Connection > > > > def receive_data(data) > > puts data > > end > > > > end > > > > EventMachine::run { > > EventMachine::connect "192.168.1.101", 7777, ExampleClient do |c| > > c.send_data "go" > > end > > } > > ==============> > > > Thanks in advance for any help you can provide. > > > > Ben > > > > > > ------------------------------ > > > > Message: 3 > > Date: Thu, 10 Apr 2008 00:00:06 -0700 > > From: Jos Backus <jos at catnook.com> > > Subject: [Eventmachine-talk] Using Ruby''s OpenSSL bindings with EM > > To: eventmachine-talk at rubyforge.org > > Message-ID: <20080410070006.GA12858 at lizzy.catnook.local> > > Content-Type: text/plain; charset=us-ascii > > > > How hard would it be to use the Ruby OpenSSL bindings from within > > Eventmachine? I''d like to expose the client cert received by the server > to > > Ruby using functions that are defined in ossl_x509cert.c which is part > of > > Ruby''s OpenSSL bindings. (This is part of an effort to make Swiftiply > work > > with Puppet.) > > > > I have hacked ssl.cpp to the point where I have SSL_VERIFY_PEER working > (so > > the client is asked to send a cert and I can call > X509_get_subject_name() on > > the cert). Now I''d like to pass the *X509 cert handle to something like > > ossl_x509_new(X509 *x509) which returns a Ruby VALUE, which in turn > could then > > be exposed through Eventmachine''s SslBox class (somehow). > > > > Any suggestions would be most welcome. > > > > -- > > Jos Backus > > jos at catnook.com > > > > > > ------------------------------ > > > > Message: 4 > > Date: Thu, 10 Apr 2008 08:09:00 -0700 > > From: "Michael S. Fischer" <michael at dynamine.net> > > Subject: Re: [Eventmachine-talk] Using Ruby''s OpenSSL bindings with EM > > To: jos at catnook.com, eventmachine-talk at rubyforge.org > > Message-ID: > > <86db848d0804100809j6055686at14085ad662a30fbe at mail.gmail.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > I''ve been asking for peer verification for months. Here''s hoping it > > finally gets in! > > > > --Michael > > > > On Thu, Apr 10, 2008 at 12:00 AM, Jos Backus <jos at catnook.com> wrote: > > > How hard would it be to use the Ruby OpenSSL bindings from within > > > Eventmachine? I''d like to expose the client cert received by the > server to > > > Ruby using functions that are defined in ossl_x509cert.c which is > part of > > > Ruby''s OpenSSL bindings. (This is part of an effort to make > Swiftiply work > > > with Puppet.) > > > > > > I have hacked ssl.cpp to the point where I have SSL_VERIFY_PEER > working (so > > > the client is asked to send a cert and I can call > X509_get_subject_name() on > > > the cert). Now I''d like to pass the *X509 cert handle to something > like > > > ossl_x509_new(X509 *x509) which returns a Ruby VALUE, which in turn > could then > > > be exposed through Eventmachine''s SslBox class (somehow). > > > > > > Any suggestions would be most welcome. > > > > > > -- > > > Jos Backus > > > jos at catnook.com > > > _______________________________________________ > > > Eventmachine-talk mailing list > > > Eventmachine-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > > > > > > > > > ------------------------------ > > > > Message: 5 > > Date: Thu, 10 Apr 2008 11:16:12 -0400 > > From: "Jason Roelofs" <jameskilton at gmail.com> > > Subject: Re: [Eventmachine-talk] Using Ruby''s OpenSSL bindings with EM > > To: eventmachine-talk at rubyforge.org > > Message-ID: > > <e078f4ba0804100816l740e6827h51899e76c649bf4d at mail.gmail.com> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > I would suggest opening up a ticket at rubyeventmachine.com to make > > sure that this request doesn''t get lost. > > > > Jason > > > > On Thu, Apr 10, 2008 at 11:09 AM, Michael S. Fischer > > <michael at dynamine.net> wrote: > > > I''ve been asking for peer verification for months. Here''s hoping it > > > finally gets in! > > > > > > --Michael > > > > > > > > > > > > On Thu, Apr 10, 2008 at 12:00 AM, Jos Backus <jos at catnook.com> > wrote: > > > > How hard would it be to use the Ruby OpenSSL bindings from within > > > > Eventmachine? I''d like to expose the client cert received by the > server to > > > > Ruby using functions that are defined in ossl_x509cert.c which is > part of > > > > Ruby''s OpenSSL bindings. (This is part of an effort to make > Swiftiply work > > > > with Puppet.) > > > > > > > > I have hacked ssl.cpp to the point where I have SSL_VERIFY_PEER > working (so > > > > the client is asked to send a cert and I can call > X509_get_subject_name() on > > > > the cert). Now I''d like to pass the *X509 cert handle to > something like > > > > ossl_x509_new(X509 *x509) which returns a Ruby VALUE, which in > turn could then > > > > be exposed through Eventmachine''s SslBox class (somehow). > > > > > > > > Any suggestions would be most welcome. > > > > > > > > -- > > > > Jos Backus > > > > jos at catnook.com > > > > _______________________________________________ > > > > Eventmachine-talk mailing list > > > > Eventmachine-talk at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > > > > > > > > _______________________________________________ > > > Eventmachine-talk mailing list > > > Eventmachine-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > > > > > > ------------------------------ > > > > Message: 6 > > Date: Fri, 11 Apr 2008 19:58:20 -0500 > > From: Seth Bollinger <seth_bollinger at comcast.net> > > Subject: [Eventmachine-talk] unbind trouble > > To: mailto: eventmachine-talk at rubyforge.org > > Message-ID: <20080412005820.GA11447 at hyperion.digi.com> > > Content-Type: text/plain; charset=us-ascii > > > > Hello All, > > > > I''m having trouble detecting when a client terminates a tcp connection > to my > > server. > > > > If I define unbind, I see the following exception raised. > > > > > /usr/lib64/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/eventmachine.rb:1071:in > `event_callback'': > > EventMachine::ConnectionNotBound (EventMachine::ConnectionNotBound) > > from > /usr/lib64/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/eventmachine.rb:226:in > > `release_machine'' > > from > /usr/lib64/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/eventmachine.rb:226:in > `run'' > > from ./order_daemon.rb:355:in `run'' > > from ./order_daemon.rb:373 > > > > I''ve added begin/rescue to all of my procedures, and I''m certain > there''s not > > an error in my code. > > > > If I don''t define unbind, the server connection will continue on it''s > merry > > way. > > > > It might be worth mentioning that I''m using an ssl socket. > > > > Also, when you add a periodic timer using the add_periodic_timer > method, there > > doesn''t seem to be a way to kill the timer. It will keep running even > if you > > return the value specified in the add_periodic_timer method (the > examples all > > show nil, this didn''t work). > > > > Thanks, > > > > Seth > > > > > > > > ------------------------------ > > > > Message: 7 > > Date: Thu, 17 Apr 2008 01:43:21 -0700 > > From: "Bill Kelly" <billk at cts.com> > > Subject: [Eventmachine-talk] run_block terminates all event > > descriptors ? > > To: <eventmachine-talk at rubyforge.org> > > Message-ID: <11ab01c8a067$17f42110$6442a8c0 at gonzo> > > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > > reply-type=original > > > > Hi, > > > > Is EventMachine.run_block intended to close socket connections and > > terminate timer events, etc., at the end of the block? > > > > I''m using EM from svn trunk, at revision 674. (head) > > > > On ruby 1.8.4 (2005-12-24) [i386-mswin32]. > > > > > > I had been hoping to use run_block to facilitate my unit testing, > > proceeding linearly through a test case, using run_block to crank > > the machine as needed until some state changed, then do some > > asserts, repeat. . . > > > > But it seems that at the end of the block executed by run_block, > > all my connections unbind. > > > > Is this the intended behavior? > > > > > > Regards, > > > > Bill > > > > > > > > > > ------------------------------ > > > > Message: 8 > > Date: Thu, 17 Apr 2008 01:55:40 -0700 > > From: "Bill Kelly" <billk at cts.com> > > Subject: Re: [Eventmachine-talk] run_block terminates all event > > descriptors ? > > To: <eventmachine-talk at rubyforge.org> > > Message-ID: <11b801c8a068$d043b400$6442a8c0 at gonzo> > > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > > reply-type=original > > > > > > From: "Bill Kelly" <billk at cts.com> > > > > > > But it seems that at the end of the block executed by run_block, > > > all my connections unbind. > > > > > > Is this the intended behavior? > > > > Errr... sorry, I see that is indeed the documented behavior of > > EventMachine::stop_event_loop. > > > > > > Hummmm... OK, I guess I''ll do my unit tests a different way. :) > > > > > > Regards, > > > > Bill > > > > > > > > > > ------------------------------ > > > > Message: 9 > > Date: Tue, 22 Apr 2008 11:12:36 -0400 > > From: "Jeff Fedor" <jeff.fedor at gmail.com> > > Subject: [Eventmachine-talk] stoopid n00b questions > > To: eventmachine-talk at rubyforge.org > > Message-ID: > > <7d7027660804220812i357bb60t331ee1e931ef247 at mail.gmail.com> > > Content-Type: text/plain; charset="iso-8859-1" > > > > New to EventMachine and Ruby so perfect storm of newbieness. So > apologies in > > advance... > > > > I checked the docs and list archives but came up empty handed on the > > following: > > > > So dumb question #1. Is there a way to get the IP address & Port of a > > running EventMachine? > > > > Dumb question #1 part 2: can you issue a EventMachine::start_server > command > > and have it grab the next available port similar to the way TCPServer > > behaves? Note, I''m not lazy just don''t know how to grab the IP & Port. > N00b > > remember > > > > thanks in advance > > j > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080422/a9da0cbf/attachment-0001.html > > > > ------------------------------ > > > > Message: 10 > > Date: Tue, 22 Apr 2008 17:06:58 -0700 > > From: "Bill Kelly" <billk at cts.com> > > Subject: Re: [Eventmachine-talk] stoopid n00b questions > > To: <eventmachine-talk at rubyforge.org> > > Message-ID: <04ce01c8a4d5$f2f23cd0$6442a8c0 at gonzo> > > Content-Type: text/plain; format=flowed; charset="iso-8859-1"; > > reply-type=original > > > > > > From: Jeff Fedor > > > > > > > question #1. Is there a way to get the IP address & Port of a running > > > EventMachine? > > > > One can obtain the IP and port of a connected TCP peer like: > > > > require ''eventmachine'' > > require ''socket'' > > > > interface_ip = "0.0.0.0" > > port = 12345 > > > > EventMachine::start_server(interface_ip, port, > EventMachine::Connection) do |client_connection| > > > > remote_port, remote_ip > Socket.unpack_sockaddr_in(client_connection.get_peername) > > > > end > > > > > > > question #1 part 2: can you issue a EventMachine::start_server > > > command and have it grab the next available port similar to the way > > > TCPServer behaves? Note, I''m not lazy just don''t know how to grab the > > > IP & Port. > > > > Except in rare cases, when one starts a server, one provides > > a known port number that one expects clients to know about and > > be connecting to. > > > > The IP address provided to start_server is an indication of which > > interface to bind to. Generally one either specifices "0.0.0.0", > > meaning accept local and external connections, or "127.0.0.1", > > meaning accept only local connections. > > > > > > Hope this helps, > > > > Bill > > > > > > > > > > > > > > ------------------------------ > > > > Message: 11 > > Date: Tue, 22 Apr 2008 21:02:25 -0400 > > From: "Jeff Fedor" <jeff.fedor at gmail.com> > > Subject: Re: [Eventmachine-talk] stoopid n00b questions > > To: eventmachine-talk at rubyforge.org > > Message-ID: > > <7d7027660804221802i7d8a07c4r313fe83d752f70c8 at mail.gmail.com> > > Content-Type: text/plain; charset="iso-8859-1" > > > > Thanks Bill. I was hoping to be able to spark up EventMachines on the > next > > available port on the fly but sounds like I''m an edge case > > > > appreciate the help > > j > > > > On Tue, Apr 22, 2008 at 8:06 PM, Bill Kelly <billk at cts.com> wrote: > > > > > > > > From: Jeff Fedor > > > > > > > > > > question #1. Is there a way to get the IP address & Port of a > running > > > > EventMachine? > > > > > > One can obtain the IP and port of a connected TCP peer like: > > > > > > require ''eventmachine'' > > > require ''socket'' > > > > > > interface_ip = "0.0.0.0" > > > port = 12345 > > > > > > EventMachine::start_server(interface_ip, port, > EventMachine::Connection) > > > do |client_connection| > > > > > > remote_port, remote_ip > > > Socket.unpack_sockaddr_in(client_connection.get_peername) > > > > > > end > > > > > > > > > > question #1 part 2: can you issue a EventMachine::start_server > > > > command and have it grab the next available port similar to the way > > > > TCPServer behaves? Note, I''m not lazy just don''t know how to grab > the > > > > IP & Port. > > > > > > Except in rare cases, when one starts a server, one provides > > > a known port number that one expects clients to know about and > > > be connecting to. > > > > > > The IP address provided to start_server is an indication of which > > > interface to bind to. Generally one either specifices "0.0.0.0", > > > meaning accept local and external connections, or "127.0.0.1", > > > meaning accept only local connections. > > > > > > > > > Hope this helps, > > > > > > Bill > > > > > > > > > > > > > > > _______________________________________________ > > > Eventmachine-talk mailing list > > > Eventmachine-talk at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > > -------------- next part -------------- > > An HTML attachment was scrubbed... > > URL: > http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080422/a0341564/attachment.html > > > > ------------------------------ > > > > _______________________________________________ > > Eventmachine-talk mailing list > > Eventmachine-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > End of Eventmachine-talk Digest, Vol 24, Issue 2 > > ************************************************ > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080429/2563e657/attachment-0001.html>
I think in C it gets set for "accepted" sockets but it''s unclear if it''s set for ''outgoing'' sockets. Do they default to it? [em.cpp] Thanks. -R On Apr 29, 2008, at 12:26 PM, Francis Cianfrocca wrote:> Out of curiosity, what would be the point of re-enabling the nagle > algorithm? It''s disabled for a reason. > > On Mon, Apr 28, 2008 at 8:16 PM, Roger Pack > <rogerpack2005 at gmail.com> wrote: > go into the C code and disable it :)-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080429/d47f842b/attachment.html>
Missing. You''re right. That''s a bug. On Tue, Apr 29, 2008 at 3:40 PM, Roger Pack <rogerpack2005 at gmail.com> wrote:> I think in C it gets set for "accepted" sockets but it''s unclear if it''s > set for ''outgoing'' sockets. Do they default to it? [em.cpp]Thanks. > -R > > On Apr 29, 2008, at 12:26 PM, Francis Cianfrocca wrote: > > Out of curiosity, what would be the point of re-enabling the nagle > algorithm? It''s disabled for a reason. > > On Mon, Apr 28, 2008 at 8:16 PM, Roger Pack <rogerpack2005 at gmail.com> > wrote: > > > go into the C code and disable it :) > > > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080429/765406a0/attachment.html>
This has been fixed in the HEAD revision of SVN. Go to http://rubyeventmachine.com to get the latest code. On Tue, Apr 29, 2008 at 3:40 PM, Roger Pack <rogerpack2005 at gmail.com> wrote:> I think in C it gets set for "accepted" sockets but it''s unclear if it''s > set for ''outgoing'' sockets. Do they default to it? [em.cpp]Thanks. > -R > > On Apr 29, 2008, at 12:26 PM, Francis Cianfrocca wrote: > > Out of curiosity, what would be the point of re-enabling the nagle > algorithm? It''s disabled for a reason. > > On Mon, Apr 28, 2008 at 8:16 PM, Roger Pack <rogerpack2005 at gmail.com> > wrote: > > > go into the C code and disable it :) > > > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/eventmachine-talk/attachments/20080430/d4af3094/attachment.html>
Thanks. On Wed, Apr 30, 2008 at 6:57 AM, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> This has been fixed in the HEAD revision of SVN. Go to > http://rubyeventmachine.com to get the latest code. > > > > On Tue, Apr 29, 2008 at 3:40 PM, Roger Pack <rogerpack2005 at gmail.com> wrote: > > > > > > > > > > > I think in C it gets set for "accepted" sockets but it''s unclear if it''s > set for ''outgoing'' sockets. Do they default to it? [em.cpp] > > Thanks. > > -R > > > > > > > > > > > > > > On Apr 29, 2008, at 12:26 PM, Francis Cianfrocca wrote: > > > > Out of curiosity, what would be the point of re-enabling the nagle > algorithm? It''s disabled for a reason. > > > > > > On Mon, Apr 28, 2008 at 8:16 PM, Roger Pack <rogerpack2005 at gmail.com> > wrote: > > > > > go into the C code and disable it :) > > > > > > > > > > > _______________________________________________ > > Eventmachine-talk mailing list > > Eventmachine-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/eventmachine-talk > > > > > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >