Permalink
Browse files

do not open the socket connection on initialize

  • Loading branch information...
1 parent 2a91824 commit 7cb89cc776dddaab32ac3fc7e39c376d9d256d56 @bumi committed Jun 30, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/validation_rage/udp_notifier.rb
@@ -2,14 +2,15 @@
module ValidationRage
class UdpNotifier < BaseNotifier
- attr_accessor :socket
+ attr_accessor :socket, :host, :port
def initialize(args)
self.socket = UDPSocket.new
- self.socket.connect(args[:host], args[:port])
+ self.host = args[:host]
+ self.port = args[:port]
end
def call(event_name, payload)
- self.socket.send(payload.to_json, 0)
+ self.socket.send(payload.to_json, 0, self.host, self.port)
end
end

0 comments on commit 7cb89cc

Please sign in to comment.