It seems inevitable that somebody will try to use StringIO with it, so
may as well make it work.
Also it caused an error with the ci_reporter gem already (#246).
Fixes#246.
Ask, don't tell, or something like that!
Now the WebSocketServer decides what port it will use and everything
else relies on that. By default an ephemeral port is used, but a fixed
port number can be passed in too.
This work is necessary to support Windows (#240) because on Windows a
TCP socket cannot be closed and immediately reopened, which we are doing
in the tests. So this change means that when restarting, a new ephemeral
port can be used by the server.
This reverts the default port setting to how it was before the 1.0
release. However the `:port` configuration option is still available for
those who need to set it to something static.
The reason for changing this back is that I have seend EADDRINUSE errors
crop up and in general had second thoughts on whether it was a good idea
to use a static port number as the default. I think it's much better and
less error prone to use any available port by default but to allow the
port number to be configured in the small number of cases where that's
necessary.
Closes#174.
posix-spawn relies on a C extension. This does work under JRuby, but it
won't work on Travis CI as they disallow JRuby C extensions, as they are
considered to not be a good practice.
Instead we are using either Process.spawn on Ruby 1.9, or the
childprocess gem on Ruby 1.8. childprocess uses native JVM APIs on
JRuby, and fork+exec on others.
Using EventMachine was causing issues when run alongside Thin.
In general running the event loop is quite slow, presumably because it
is mostly spinning idly wasting cycles (unsure). We were mitigating
this by stopping the thread when it wasn't needed, but this is
incorrect when Thin is also running.
Implemented WebSocket server using raw TCP sockets and a WebSocket
parser provided by faye-websocket. This is faster and neater and removes
the need to dick around with threads.
Fixes#6.