Skip to content
Browse files

Added method of binary data send

  • Loading branch information...
1 parent 9ee9e44 commit 2745e903b1975786d66740f6c75fd7dda949d21e kyubuns committed Sep 12, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/em-websocket/connection.rb
View
10 lib/em-websocket/connection.rb
@@ -166,6 +166,16 @@ def send(data)
return nil
end
+ # Send a WebSocket binary frame.
+ #
+ def send_binary(data)
+ if @handler
+ @handler.send_frame(:binary, data)
+ else
+ raise WebSocketError, "Cannot send binary before onopen callback"
+ end
+ end
+
# Send a ping to the client. The client must respond with a pong.
#
# In the case that the client is running a WebSocket draft < 01, false

0 comments on commit 2745e90

Please sign in to comment.
Something went wrong with that request. Please try again.