Class Thrift::ServerSocket
In: lib/thrift/transport/server_socket.rb
lib/thrift/transport/server_socket.rb
Parent: BaseServerTransport

Methods

accept   accept   close   close   closed?   closed?   listen   listen   new   new  

External Aliases

handle -> to_io
handle -> to_io

Attributes

handle  [R] 
handle  [R] 

Public Class methods

call-seq: initialize(host = nil, port)

[Source]

    # File lib/thrift/transport/server_socket.rb, line 26
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

call-seq: initialize(host = nil, port)

[Source]

    # File lib/thrift/transport/server_socket.rb, line 26
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

[Source]

    # File lib/thrift/transport/server_socket.rb, line 43
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

[Source]

    # File lib/thrift/transport/server_socket.rb, line 43
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

[Source]

    # File lib/thrift/transport/server_socket.rb, line 52
52:     def close
53:      @handle.close unless @handle.nil? or @handle.closed?
54:      @handle = nil
55:     end

[Source]

    # File lib/thrift/transport/server_socket.rb, line 52
52:     def close
53:      @handle.close unless @handle.nil? or @handle.closed?
54:      @handle = nil
55:     end

[Source]

    # File lib/thrift/transport/server_socket.rb, line 57
57:     def closed?
58:       @handle.nil? or @handle.closed?
59:     end

[Source]

    # File lib/thrift/transport/server_socket.rb, line 57
57:     def closed?
58:       @handle.nil? or @handle.closed?
59:     end

[Source]

    # File lib/thrift/transport/server_socket.rb, line 39
39:     def listen
40:       @handle = TCPServer.new(@host, @port)
41:     end

[Source]

    # File lib/thrift/transport/server_socket.rb, line 39
39:     def listen
40:       @handle = TCPServer.new(@host, @port)
41:     end

[Validate]