For some reason the call to super in Tester2#initialize causes a
connection-not-bound error.
If I make:
A) The argument list for both initialize blocks the same
B) Remove the call to super in Tester2#initialize
C) Do not call super in Tester2#initialize
Then it doesn''t give me the error.
But of course this is a mock example of my real code.
And this really shouldn''t be happening.
-------------------------------------------------------------
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.11.0/lib/eventmachine.rb:1063:in
`event_callback'': EventMachine::ConnectionNotBound
(EventMachine::ConnectionNotBound)
from
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.11.0/lib/eventmachine.rb:226:in
`release_machine''
from
/usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.11.0/lib/eventmachine.rb:226:in
`run''
from ./udp_test.rb:18
-------------------------------------------------------------
#!/usr/bin/env ruby
require ''rubygems''
require ''eventmachine''
class Tester < EM::Connection
def initialize
end
end
class Tester2 < Tester
def initialize arg1
super
end
end
EM::run {
EM::connect("127.0.0.1",5555,Tester2,1)
}
ConnectionNotBound usually means there''s a Ruby error being thrown out of your code. If that''s what this turns out to be, then it''s a bug in EM. We shouldn''t be trapping Ruby errors. On Jan 30, 2008 10:03 PM, Daniel Aquino <mr.danielaquino at gmail.com> wrote:> For some reason the call to super in Tester2#initialize causes a > connection-not-bound error. > > If I make: > > A) The argument list for both initialize blocks the same > B) Remove the call to super in Tester2#initialize > C) Do not call super in Tester2#initialize > > Then it doesn''t give me the error. > > But of course this is a mock example of my real code. > > And this really shouldn''t be happening. > > ------------------------------------------------------------- > /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.11.0 > /lib/eventmachine.rb:1063:in > `event_callback'': EventMachine::ConnectionNotBound > (EventMachine::ConnectionNotBound) > from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.11.0 > /lib/eventmachine.rb:226:in > `release_machine'' > from /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.11.0 > /lib/eventmachine.rb:226:in > `run'' > from ./udp_test.rb:18 > > ------------------------------------------------------------- > #!/usr/bin/env ruby > > require ''rubygems'' > require ''eventmachine'' > > class Tester < EM::Connection > def initialize > end > end > > class Tester2 < Tester > def initialize arg1 > super > end > end > > EM::run { > EM::connect("127.0.0.1",5555,Tester2,1) > } > _______________________________________________ > 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/20080131/77d2be14/attachment-0001.html
I got around this issue by making Tester a module. On Jan 31, 2008 9:29 AM, Francis Cianfrocca <garbagecat10 at gmail.com> wrote:> ConnectionNotBound usually means there''s a Ruby error being thrown out of > your code. > > If that''s what this turns out to be, then it''s a bug in EM. We shouldn''t be > trapping Ruby errors. > > > > On Jan 30, 2008 10:03 PM, Daniel Aquino <mr.danielaquino at gmail.com> wrote: > > > > > > > > For some reason the call to super in Tester2#initialize causes a > > connection-not-bound error. > > > > If I make: > > > > A) The argument list for both initialize blocks the same > > B) Remove the call to super in Tester2#initialize > > C) Do not call super in Tester2#initialize > > > > Then it doesn''t give me the error. > > > > But of course this is a mock example of my real code. > > > > And this really shouldn''t be happening. > > > > ------------------------------------------------------------- > > > /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.11.0/lib/eventmachine.rb:1063:in > > `event_callback'': EventMachine::ConnectionNotBound > > (EventMachine::ConnectionNotBound) > > from > /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.11.0/lib/eventmachine.rb:226:in > > `release_machine'' > > from > /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.11.0/lib/eventmachine.rb:226:in > > `run'' > > from ./udp_test.rb:18 > > > > ------------------------------------------------------------- > > #!/usr/bin/env ruby > > > > require ''rubygems'' > > require ''eventmachine'' > > > > class Tester < EM::Connection > > def initialize > > end > > end > > > > class Tester2 < Tester > > def initialize arg1 > > super > > end > > end > > > > EM::run { > > EM::connect("127.0.0.1",5555,Tester2,1) > > } > > _______________________________________________ > > 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 >