Class: Thin::Backends::TcpServer

### Home Classes Methods

### In Files

- lib/thin/backends/tcp_server.rb

### Parent

Thin::Backends::Base

### Methods

- ::new
- #connect
- #disconnect
- #to_s

### Class/Module Index

Quicksearch

- Thin
- Thin::Backends
- Thin::Backends::Base
- Thin::Backends::SwiftiplyClient
- Thin::Backends::TcpServer
- Thin::Backends::UnixServer
- Thin::Command
- Thin::Connection
- Thin::Controllers
- Thin::Controllers::Cluster
- Thin::Controllers::Controller
- Thin::Controllers::Service
- Thin::Daemonizable
- Thin::Daemonizable::ClassMethods
- Thin::Headers
- Thin::InvalidOption
- Thin::InvalidRequest
- Thin::Logging
- Thin::Logging::SimpleFormatter
- Thin::OptionRequired
- Thin::PidFileExist
- Thin::PidFileNotFound
- Thin::PlatformNotSupported
- Thin::Request
- Thin::Response
- Thin::RestartTimeout
- Thin::Runner
- Thin::RunnerError
- Thin::Server
- Thin::Stats
- Thin::Stats::Adapter
- Thin::SwiftiplyConnection
- Thin::UnixConnection
- Rack
- Rack::Adapter
- Rack::Adapter::Rails
- Rack::Adapter::Rails::CGIWrapper
- Rack::Adapter::Rails::CgiApp
- Rack::AdapterNotFound
- Process

No matching classes.

# Thin::Backends::TcpServer

Backend to act as a TCP socket server.

### Attributes

host[RW]

Address and port on which the server is listening for connections.

port[RW]

Address and port on which the server is listening for connections.

### Public Class Methods

new(host, port) click to toggle source

    # File lib/thin/backends/tcp_server.rb, line 8
    def initialize(host, port)
      @host = host
      @port = port
      super()
    end

### Public Instance Methods

connect() click to toggle source

Connect the server

    # File lib/thin/backends/tcp_server.rb, line 15
    def connect
      @signature = EventMachine.start_server(@host, @port, Connection, &method(:initialize_connection))
    end

disconnect() click to toggle source

Stops the server

    # File lib/thin/backends/tcp_server.rb, line 20
    def disconnect
      EventMachine.stop_server(@signature)
    end

to_s() click to toggle source

    # File lib/thin/backends/tcp_server.rb, line 24
    def to_s
      "#{@host}:#{@port}"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.