class Thrift::UNIXServerSocket
Attributes
Public Class Methods
Source
# File lib/thrift/transport/unix_server_socket.rb 26 def initialize(path, client_timeout: DEFAULT_CLIENT_TIMEOUT) 27 @path = path 28 @client_timeout = client_timeout 29 @handle = nil 30 end
Public Instance Methods
Source
# File lib/thrift/transport/unix_server_socket.rb 39 def accept 40 unless @handle.nil? 41 sock = @handle.accept 42 trans = UNIXSocket.new(nil) 43 trans.timeout = @client_timeout 44 trans.handle = sock 45 trans 46 end 47 end
Source
# File lib/thrift/transport/unix_server_socket.rb 49 def close 50 if @handle 51 @handle.close unless @handle.closed? 52 @handle = nil 53 # UNIXServer doesn't delete the socket file, so we have to do it ourselves 54 File.delete(@path) 55 end 56 end
Source
# File lib/thrift/transport/unix_server_socket.rb 58 def closed? 59 @handle.nil? or @handle.closed? 60 end
Source
# File lib/thrift/transport/unix_server_socket.rb 35 def listen 36 @handle = ::UNIXServer.new(@path) 37 end
Source
# File lib/thrift/transport/unix_server_socket.rb 64 def to_s 65 "domain(#{@path})" 66 end