Class: Plum::Rack::UNIXListener
Instance Method Summary
collapse
#method_missing
Constructor Details
Returns a new instance of UNIXListener.
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
# File 'lib/plum/rack/listener.rb', line 98
def initialize(lc)
if File.exist?(lc[:path])
begin
old = UNIXSocket.new(lc[:path])
rescue SystemCallError, IOError
File.unlink(lc[:path])
else
old.close
raise "Already a server bound to: #{lc[:path]}"
end
end
@server = ::UNIXServer.new(lc[:path])
File.chmod(lc[:mode], lc[:path]) if lc[:mode]
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Plum::Rack::BaseListener
Instance Method Details
#stop ⇒ Object
115
116
117
118
|
# File 'lib/plum/rack/listener.rb', line 115
def stop
super
File.unlink(lc[:path])
end
|
#to_io ⇒ Object
120
121
122
|
# File 'lib/plum/rack/listener.rb', line 120
def to_io
@server.to_io
end
|