# File lib/websocket-client-simple/client.rb, line 70 def send(data, opt={:type => :text}) return if !@handshaked or @closed type = opt[:type] frame = ::WebSocket::Frame::Outgoing::Client.new(:data => data, :type => type, :version => @handshake.version) begin @socket.write frame.to_s rescue Errno::EPIPE => e @pipe_broken = true emit :__close, e end end