Sha256: afcff474e5df53eb01ab70f0faaec55112d56ac86aae507a8b9596b43b24ac8c

Contents?: true

Size: 677 Bytes

Versions: 97

Compression:

Stored size: 677 Bytes

Contents

module Thin
  module Backends
    # Backend to act as a TCP socket server.
    class TcpServer < Base
      # Address and port on which the server is listening for connections.
      attr_accessor :host, :port
      
      def initialize(host, port)
        @host = host
        @port = port
        super()
      end
      
      # Connect the server
      def connect
        @signature = EventMachine.start_server(@host, @port, Connection, &method(:initialize_connection))
      end
      
      # Stops the server
      def disconnect
        EventMachine.stop_server(@signature)
      end
            
      def to_s
        "#{@host}:#{@port}"
      end
    end
  end
end

Version data entries

97 entries across 97 versions & 8 rubygems

Version Path
classiccms-0.5.6 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.5.5 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.5.2 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.5.1 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.5.0 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.4.2 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.4.1 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.4.0 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.3.9 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
thin-1.4.1 lib/thin/backends/tcp_server.rb
thin-1.4.0 lib/thin/backends/tcp_server.rb
classiccms-0.3.8 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.3.7 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.3.6 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.3.5 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.3.4 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.3.3 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.3.2 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.3.1 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb
classiccms-0.3.0 vendor/bundle/gems/thin-1.3.1/lib/thin/backends/tcp_server.rb