Class: Faye::Server::Socket

Inherits:
Object
  • Object
show all
Defined in:
lib/faye/protocol/socket.rb

Instance Method Summary collapse

Constructor Details

#initialize(server, socket) ⇒ Socket

Returns a new instance of Socket.



5
6
7
8
# File 'lib/faye/protocol/socket.rb', line 5

def initialize(server, socket)
  @server = server
  @socket = socket
end

Instance Method Details

#closeObject



16
17
18
# File 'lib/faye/protocol/socket.rb', line 16

def close
  @socket.close
end

#send(message) ⇒ Object



10
11
12
13
14
# File 'lib/faye/protocol/socket.rb', line 10

def send(message)
  @server.pipe_through_extensions(:outgoing, message) do |piped_message|
    @socket.send(Faye.to_json([piped_message]))
  end
end