Class FTW::Server
In: lib/ftw/server.rb
lib/ftw/server.rb
Parent: Object

A web server.

Methods

each_connection   each_connection   new   new   stop   stop  

Classes and Modules

Class FTW::Server::InvalidAddress
Class FTW::Server::ServerSetupFailure

Constants

ADDRESS_RE = /^(.*):([^:]+)$/   The pattern addresses must match. This is used in FTW::Server#initialize.
ADDRESS_RE = /^(.*):([^:]+)$/   The pattern addresses must match. This is used in FTW::Server#initialize.

Public Class methods

Create a new server listening on the given addresses

This method will create, bind, and listen, so any errors during that process be raised as ServerSetupFailure

The parameter ‘addresses’ can be a single string or an array of strings. These strings MUST have the form "address:port". If the ‘address’ part is missing, it is assumed to be 0.0.0.0

Create a new server listening on the given addresses

This method will create, bind, and listen, so any errors during that process be raised as ServerSetupFailure

The parameter ‘addresses’ can be a single string or an array of strings. These strings MUST have the form "address:port". If the ‘address’ part is missing, it is assumed to be 0.0.0.0

Public Instance methods

Yield FTW::Connection instances to the block as clients connect.

Yield FTW::Connection instances to the block as clients connect.

Stop serving.

Stop serving.

[Validate]