postrank-labs/goliath — Issue #103: WebSocket connection: close_connection_after_write missing
Author: sleeper
Created: 2011-11-22 10:06:05+00:00
State: open

Goliath creates its own websocket connection (in websocket.rb, line 37), that intends working like an `EventMachine::WebSocket::Connection` object.

However it does not impleent all the messages exposed by the `EventMachine::WebSocket::Connection`, notably the `close_connection_after_write` is missing, leading in some cases to errors like:

```
[10119:ERROR] 2011-11-21 14:04:12 :: undefined method `close_connection_after_writing' for #<#:0xa356fd8>
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/gems/em-websocket-0.3.5/lib/em-websocket/framing76.rb:62:in `process_data'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/gems/em-websocket-0.3.5/lib/em-websocket/handler.rb:28:in `receive_data'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/bundler/gems/goliath-11288bd2b3ae/lib/goliath/websocket.rb:17:in `on_body'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/bundler/gems/goliath-11288bd2b3ae/lib/goliath/request.rb:97:in `call'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/bundler/gems/goliath-11288bd2b3ae/lib/goliath/request.rb:97:in `parse'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/bundler/gems/goliath-11288bd2b3ae/lib/goliath/connection.rb:72:in `receive_data'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/gems/em-synchrony-1.0.0/lib/em-synchrony.rb:27:in `synchrony'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/bundler/gems/goliath-11288bd2b3ae/lib/goliath/server.rb:73:in `start'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/bundler/gems/goliath-11288bd2b3ae/lib/goliath/runner.rb:236:in `run_server'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/bundler/gems/goliath-11288bd2b3ae/lib/goliath/runner.rb:170:in `run'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/bundler/gems/goliath-11288bd2b3ae/lib/goliath/application.rb:123:in `run!'
/home/sleeper/.rvm/gems/ruby-1.9.2-p290@bhive/bundler/gems/goliath-11288bd2b3ae/lib/goliath/application.rb:141:in `block in '
```