Browse files

Update autobahn client and add results to readme

  • Loading branch information...
1 parent 4682b22 commit 47262a5f086764afcd434f29d51fcd61f519bb0d @imanel committed Dec 20, 2012
Showing with 3 additions and 5 deletions.
  1. +1 −0 README.md
  2. +2 −5 examples/autobahn_client.rb
View
1 README.md
@@ -2,6 +2,7 @@
WebSocket-EventMachine-Client is Ruby WebSocket client based on EventMachine.
+- [Autobahn tests](http://imanel.github.com/websocket-ruby/autobahn/client)
- [Docs](http://rdoc.info/github/imanel/websocket-eventmachine-client/master/frames)
## Installation
View
7 examples/autobahn_client.rb
@@ -6,7 +6,7 @@
EM.run do
host = 'ws://localhost:9001'
- agent = "WebSocket-Ruby (Ruby #{RUBY_VERSION})"
+ agent = "WebSocket-EventMachine-Client (1.0.0)"
cases = 0
skip = []
@@ -32,17 +32,14 @@
EM.next_tick { run_case.call(n+1) }
else
- puts "$ Test number #{n}"
ws = WebSocket::EventMachine::Client.connect(:uri => "#{host}/runCase?case=#{n}&agent=#{CGI.escape agent}")
ws.onmessage do |msg, type|
- puts "Received #{msg}(#{type})"
ws.send(msg, :type => type)
end
ws.onclose do |msg|
- puts("Closing: #{msg}") if msg
- run_case.call(n + 1)
+ EM.add_timer(0.1) { run_case.call(n + 1) }
end
end
end

0 comments on commit 47262a5

Please sign in to comment.