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.
193 194 195 196 197 198 199 200 |
# File 'lib/app_profiler/server.rb', line 193 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
202 203 204 |
# File 'lib/app_profiler/server.rb', line 202 def client UNIXSocket.new(@socket_file) end |
#stop ⇒ Object
206 207 208 209 |
# File 'lib/app_profiler/server.rb', line 206 def stop File.unlink(@socket_file) if File.exist?(@socket_file) && File.socket?(@socket_file) @socket.close end |