Class: Hokaido::Broadcast::Connection
- Inherits:
-
Object
- Object
- Hokaido::Broadcast::Connection
- Includes:
- Celluloid
- Defined in:
- lib/hokaido/broadcast.rb
Instance Method Summary collapse
-
#initialize(host, port) ⇒ Connection
constructor
A new instance of Connection.
- #send(data) ⇒ Object
Constructor Details
#initialize(host, port) ⇒ Connection
Returns a new instance of Connection.
12 13 14 15 16 |
# File 'lib/hokaido/broadcast.rb', line 12 def initialize(host, port) @socket = TCPSocket.new(host, port) @socket.puts 'broadcast' end |
Instance Method Details
#send(data) ⇒ Object
18 19 20 |
# File 'lib/hokaido/broadcast.rb', line 18 def send(data) @socket.write data end |