Skip to content

Add EventMachine::attach_server#271

Closed
ramonmaruko wants to merge 1 commit intoeventmachine:masterfrom
ramonmaruko:attach_server
Closed

Add EventMachine::attach_server#271
ramonmaruko wants to merge 1 commit intoeventmachine:masterfrom
ramonmaruko:attach_server

Conversation

@ramonmaruko
Copy link
Copy Markdown

EventMachine::attach_Server is for attaching an arbitrary server IO
object or file descriptor to the event loop.

Tries to fix #93.

Signed-off-by: Ramon Marco L. Navarro [email protected]

EventMachine::attach_Server is for attaching an arbitrary server IO
object or file descriptor to the event loop.

Tries to fix eventmachine#93.

Signed-off-by: Ramon Marco L. Navarro <[email protected]>
@macournoyer
Copy link
Copy Markdown
Contributor

What are the chances of this getting in 1.0?

I'm working on v2 of Thin and relying on this: https://github.com/macournoyer/thin/blob/v2/lib/thin/server.rb#L182.

Also it seems to me this would allow moving all of the socket creation code to Ruby. Thus making implementing IPv6 support and such trivial.

@ibc
Copy link
Copy Markdown
Contributor

ibc commented Feb 22, 2012

This would be a really cool enhacement to EventMachine. Hopefully EM developers could accept this pull request.

@ibc
Copy link
Copy Markdown
Contributor

ibc commented Feb 22, 2012

One question: would EventMachine::attach_server also allow adding a Ruby Socket (i.e. TCPSocket or OpenSSL::Socket) for acting as a connection client? this is, for establishing a connection with another server, rather than accepting incoming connections?

If not, would it be very difficult to add a EventMachine::attach_client? :)

@macournoyer
Copy link
Copy Markdown
Contributor

There's already a method for that: EM.attach.

On Wed, Feb 22, 2012 at 1:14 PM, Iaki Baz Castillo <
[email protected]

wrote:

One question: would EventMachine::attach_server also allow adding a Ruby
Socket (i.e. TCPSocket or OpenSSL::Socket) for acting as a connection
client? this is, for establishing a connection with another server, rather
than accepting incoming connections?

If not, would it be very difficult to add a EventMachine::attach_client? :)


Reply to this email directly or view it on GitHub:
#271 (comment)

M-A
http://macournoyer.com

@ibc
Copy link
Copy Markdown
Contributor

ibc commented Feb 22, 2012

Sorry, you are right. Let me just a question:

Should it already be possible to use OpenSSL::Socket within EM via EM.attach and establish a SSL connection from EM to an external server?

@macournoyer
Copy link
Copy Markdown
Contributor

I believe it should work. Should work w/ any kind of socket...

But there's already support for SSL built inside EM, check the start_tls
method.

On Wed, Feb 22, 2012 at 2:48 PM, Iaki Baz Castillo <
[email protected]

wrote:

Sorry, you are right. Let me just a question:

Should it already be possible to use OpenSSL::Socket within EM via
EM.attach and establish a SSL connection from EM to an external server?


Reply to this email directly or view it on GitHub:
#271 (comment)

M-A
http://macournoyer.com

@ibc
Copy link
Copy Markdown
Contributor

ibc commented Feb 23, 2012

Yes, but I don't want to use EM's SSL, it leaks, there is an open issue showing it.

@ibc
Copy link
Copy Markdown
Contributor

ibc commented Mar 4, 2012

Hi, this pull request (along with others) has been included in EventMachine-LE: https://github.com/ibc/EventMachine-LE

@marcoow
Copy link
Copy Markdown

marcoow commented Jan 10, 2013

What's the state of this? I'm trying to run Goliath servers with stripe's einhorn and thus would need sth. like this.

@ibc
Copy link
Copy Markdown
Contributor

ibc commented Jan 10, 2013

@macournoyer macournoyer mentioned this pull request Mar 14, 2013
27 tasks
@ramonmaruko
Copy link
Copy Markdown
Author

I think it's safe to close this now that #465 has been merged.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this was superseded by #465, I am looking into JRuby test failures in #551 and I don't see where attach_server_fd is defined for the JRuby implementation. So even though you're making sure to use JRuby.runtime.getDescriptorByFileno, it's not getting passed into a valid function, AFAICT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EM.attach_server patch

6 participants