class Thrift::UNIXServerSocket

Attributes

handle[RW]
to_io[RW]

Public Class Methods

new(path) click to toggle source
   # File lib/thrift/transport/unix_server_socket.rb
25 def initialize(path)
26   @path = path
27   @handle = nil
28 end

Public Instance Methods

accept() click to toggle source
   # File lib/thrift/transport/unix_server_socket.rb
36 def accept
37   unless @handle.nil?
38     sock = @handle.accept
39     trans = UNIXSocket.new(nil)
40     trans.handle = sock
41     trans
42   end
43 end
close() click to toggle source
   # File lib/thrift/transport/unix_server_socket.rb
45 def close
46   if @handle
47     @handle.close unless @handle.closed?
48     @handle = nil
49     # UNIXServer doesn't delete the socket file, so we have to do it ourselves
50     File.delete(@path)
51   end
52 end
closed?() click to toggle source
   # File lib/thrift/transport/unix_server_socket.rb
54 def closed?
55   @handle.nil? or @handle.closed?
56 end
listen() click to toggle source
   # File lib/thrift/transport/unix_server_socket.rb
32 def listen
33   @handle = ::UNIXServer.new(@path)
34 end