perplexes/m2r — pull request #18 by paneq (2012-07-17 22:46:24+00:00)
Title: Change Connection constructor to take sockets

The connection needs only request and response sockets as dependency
for proper working. For the most simple case `Connection` working
with one instance of _mongrel2_ can be created using `Connection.for`
method instead of `Connection.new` :

```ruby
Connection.for(sender_id, request_addr, response_addr, context)
```

Standard method using

```ruby
Connection.new(request_socket, response_socket)
```

is used for more general usecase. For example if someone wants the
handler to work with two _mongrel2_ instances the sockets can be
created "by hand" and connected to both mongrels.

That way we have standard constructor for general usage and
a method delegated for the most common case that takes identical arguments
as `initialize` did before this refactoring.