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, line 24
def initialize(path)
  @path = path
  @handle = nil
end

Public Instance Methods

accept() click to toggle source
# File lib/thrift/transport/unix_server_socket.rb, line 35
def accept
  unless @handle.nil?
    sock = @handle.accept
    trans = UNIXSocket.new(nil)
    trans.handle = sock
    trans
  end
end
close() click to toggle source
# File lib/thrift/transport/unix_server_socket.rb, line 44
def close
  if @handle
    @handle.close unless @handle.closed?
    @handle = nil
    # UNIXServer doesn't delete the socket file, so we have to do it ourselves
    File.delete(@path)
  end
end
closed?() click to toggle source
# File lib/thrift/transport/unix_server_socket.rb, line 53
def closed?
  @handle.nil? or @handle.closed?
end
listen() click to toggle source
# File lib/thrift/transport/unix_server_socket.rb, line 31
def listen
  @handle = ::UNIXServer.new(@path)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.