Class: Nodule::UnixServer

Inherits:
Tempfile show all
Defined in:
lib/nodule/unixsocket.rb

Instance Attribute Summary

Attributes inherited from Tempfile

#file

Attributes inherited from Base

#prefix, #read_count, #readers, #running, #topology

Instance Method Summary collapse

Methods inherited from Tempfile

#initialize, #stop, #touch

Methods inherited from Base

#add_reader, #add_readers, #clear!, #done?, #initialize, #join_topology!, #output, #output!, #output?, #read_until, #require_read_count, #run_readers, #stop, #stop!, #verbose, #wait, #wait_with_backoff

Constructor Details

This class inherits a constructor from Nodule::Tempfile

Instance Method Details

#runObject



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/nodule/unixsocket.rb', line 37

def run
  super
  @thread = Thread.new do
    Thread.current.abort_on_exception

    server = Socket.new(:UNIX, @family, 0)
    address = Addrinfo.unix(@file)
    server.bind(address)

    message, = server.recvmsg(65536, 0) if sock
  end
end

#to_sObject



50
51
52
# File 'lib/nodule/unixsocket.rb', line 50

def to_s
  @sockfile
end