Class: Thrift::ServerSocket

### Home Classes Methods

### In Files

- lib/thrift/transport/server_socket.rb

### Parent

Thrift::BaseServerTransport

### Methods

- ::new
- #accept
- #close
- #closed?
- #listen

### Files

- CHANGELOG
- README
- Makefile

### Class/Module Index

Quicksearch

- Thrift
- Thrift::ApplicationException
- Thrift::BaseProtocol
- Thrift::BaseProtocolFactory
- Thrift::BaseServer
- Thrift::BaseServerTransport
- Thrift::BaseTransport
- Thrift::BaseTransportFactory
- Thrift::BinaryProtocol
- Thrift::BinaryProtocolAcceleratedFactory
- Thrift::BinaryProtocolFactory
- Thrift::BufferedTransport
- Thrift::BufferedTransportFactory
- Thrift::Client
- Thrift::CompactProtocol
- Thrift::CompactProtocol::CompactTypes
- Thrift::CompactProtocolFactory
- Thrift::Deserializer
- Thrift::Exception
- Thrift::FramedTransport
- Thrift::FramedTransportFactory
- Thrift::HTTPClientTransport
- Thrift::IOStreamTransport
- Thrift::MemoryBufferTransport
- Thrift::MessageTypes
- Thrift::MongrelHTTPServer
- Thrift::MongrelHTTPServer::Handler
- Thrift::NonblockingServer
- Thrift::Processor
- Thrift::ProtocolException
- Thrift::Serializer
- Thrift::ServerSocket
- Thrift::SimpleServer
- Thrift::Socket
- Thrift::Struct
- Thrift::Struct_Union
- Thrift::ThreadPoolServer
- Thrift::ThreadedServer
- Thrift::TransportException
- Thrift::TransportUtils
- Thrift::TypeError
- Thrift::Types
- Thrift::UNIXServerSocket
- Thrift::UNIXSocket
- Thrift::Union
- Fixnum

No matching classes.

# 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.