class Thrift::ServerSocket
Attributes
handle[R]
to_io[R]
Public Class Methods
initialize(host = nil, port)
click to toggle source
# File lib/thrift/transport/server_socket.rb 26 def initialize(host_or_port, port = nil) 27 if port 28 @host = host_or_port 29 @port = port 30 else 31 @host = nil 32 @port = host_or_port 33 end 34 @handle = nil 35 end
Public Instance Methods
accept()
click to toggle source
# File lib/thrift/transport/server_socket.rb 43 def accept 44 unless @handle.nil? 45 sock = @handle.accept 46 trans = Socket.new 47 trans.handle = sock 48 trans 49 end 50 end
close()
click to toggle source
# File lib/thrift/transport/server_socket.rb 52 def close 53 @handle.close unless @handle.nil? or @handle.closed? 54 @handle = nil 55 end
closed?()
click to toggle source
# File lib/thrift/transport/server_socket.rb 57 def closed? 58 @handle.nil? or @handle.closed? 59 end
listen()
click to toggle source
# File lib/thrift/transport/server_socket.rb 39 def listen 40 @handle = TCPServer.new(@host, @port) 41 end
to_s()
click to toggle source
# File lib/thrift/transport/server_socket.rb 63 def to_s 64 "socket(#{@host}:#{@port})" 65 end