Module: EventMachine::Syslog::ConnectionUDP

Included in:
UNIX
Defined in:
lib/em-syslog/connection_udp.rb,
lib/em-syslog/connection_unix.rb

Overview

Our module to pass to EventMachine to handle the UDP Connection over IP Socket

Defined Under Namespace

Modules: UNIX

Instance Method Summary collapse

Instance Method Details

#notify_readableObject

Should not be needed



17
18
19
# File 'lib/em-syslog/connection_udp.rb', line 17

def notify_readable
  read_packet
end

#read_packetObject

Should not be needed



24
25
26
27
# File 'lib/em-syslog/connection_udp.rb', line 24

def read_packet
  data, sender = @unix_connection.recvfrom( 1024)
  true
end

#send_msg(msg) ⇒ Object

Handle no buffering just send it



32
33
34
# File 'lib/em-syslog/connection_udp.rb', line 32

def send_msg( msg)
  send_datagram( msg, @host, @port)
end

#setup(host, port) ⇒ Object



9
10
11
12
# File 'lib/em-syslog/connection_udp.rb', line 9

def setup( host, port)
  @host = host
  @port = port
end