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, line 25
def initialize(host_or_port, port = nil)
  if port
    @host = host_or_port
    @port = port
  else
    @host = nil
    @port = host_or_port
  end
  @handle = nil
end

Public Instance Methods

accept() click to toggle source
# File lib/thrift/transport/server_socket.rb, line 42
def accept
  unless @handle.nil?
    sock = @handle.accept
    trans = Socket.new
    trans.handle = sock
    trans
  end
end
close() click to toggle source
# File lib/thrift/transport/server_socket.rb, line 51
def close
 @handle.close unless @handle.nil? or @handle.closed?
 @handle = nil
end
closed?() click to toggle source
# File lib/thrift/transport/server_socket.rb, line 56
def closed?
  @handle.nil? or @handle.closed?
end
listen() click to toggle source
# File lib/thrift/transport/server_socket.rb, line 38
def listen
  @handle = TCPServer.new(@host, @port)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.