Class: Fyrehose::UDPClient
Constant Summary
AbstractClient::TIMEOUT
Instance Method Summary
collapse
#deliver, #initialize
Instance Method Details
#open_connection ⇒ Object
3
4
5
6
|
# File 'lib/fyrehose/udp_client.rb', line 3
def open_connection
@sock = UDPSocket.new
@sock.connect(@host, @port)
end
|
#send_data(data) ⇒ Object
8
9
10
11
12
13
14
15
16
|
# File 'lib/fyrehose/udp_client.rb', line 8
def send_data(data)
Timeout::timeout(@timeout) do
open_connection unless @sock
@sock.send(data, 0); 0
end
rescue Exception => e
@sock = nil
raise e
end
|