Class: AppProfiler::Server::ProfileServer::UNIX
- Defined in:
- lib/app_profiler/server.rb
Instance Attribute Summary
Attributes inherited from Transport
Instance Method Summary collapse
- #client ⇒ Object
-
#initialize ⇒ UNIX
constructor
A new instance of UNIX.
- #stop ⇒ Object
Constructor Details
#initialize ⇒ UNIX
Returns a new instance of UNIX.
148 149 150 151 152 153 154 |
# File 'lib/app_profiler/server.rb', line 148 def initialize super FileUtils.mkdir_p(PROFILER_TEMPFILE_PATH) @socket_file = File.join(PROFILER_TEMPFILE_PATH, "app-profiler-#{Process.pid}.sock") File.unlink(@socket_file) if File.exist?(@socket_file) && File.socket?(@socket_file) @socket = UNIXServer.new(@socket_file) end |
Instance Method Details
#client ⇒ Object
156 157 158 |
# File 'lib/app_profiler/server.rb', line 156 def client UNIXSocket.new(@socket_file) end |
#stop ⇒ Object
160 161 162 163 |
# File 'lib/app_profiler/server.rb', line 160 def stop File.unlink(@socket_file) if File.exist?(@socket_file) && File.socket?(@socket_file) @socket.close end |