Module: SysLogger::Creators

Defined in:
lib/syslogger/creators.rb

Class Method Summary collapse

Class Method Details

.unix_dgram_socket(socket_path) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/syslogger/creators.rb', line 6

def self.unix_dgram_socket(socket_path)
  proc {
    client = Socket.new(Socket::Constants::AF_LOCAL, Socket::Constants::SOCK_DGRAM, 0)
    client.connect(Socket.pack_sockaddr_un(socket_path))
    client
  }
end

.unix_stream_socket(socket_path) ⇒ Object



14
15
16
17
18
# File 'lib/syslogger/creators.rb', line 14

def self.unix_stream_socket(socket_path)
  proc {
    UnixSocket.new(socket_path)
  }
end