Class: Fnord::UDPConnection
- Inherits:
-
Object
- Object
- Fnord::UDPConnection
- Defined in:
- lib/fnord/udp_connection.rb
Instance Attribute Summary collapse
-
#socket ⇒ Object
Returns the value of attribute socket.
Instance Method Summary collapse
-
#initialize(host, port = 1337, options = {}) ⇒ UDPConnection
constructor
A new instance of UDPConnection.
- #send_data(data) ⇒ Object
Constructor Details
#initialize(host, port = 1337, options = {}) ⇒ UDPConnection
Returns a new instance of UDPConnection.
6 7 8 |
# File 'lib/fnord/udp_connection.rb', line 6 def initialize(host, port = 1337, = {}) @host, @port, @options = host, port, end |
Instance Attribute Details
#socket ⇒ Object
Returns the value of attribute socket.
4 5 6 |
# File 'lib/fnord/udp_connection.rb', line 4 def socket @socket end |
Instance Method Details
#send_data(data) ⇒ Object
10 11 12 13 |
# File 'lib/fnord/udp_connection.rb', line 10 def send_data(data) # Rails.logger.info "[FNORD] Sending data\n#{data}" socket.send(data, 0, @host, @port) end |