Package cherrypy :: Package wsgiserver :: Module wsgiserver3 :: Class HTTPServer
[hide private]
[frames] | no frames]

Class HTTPServer

source code

object --+
         |
        HTTPServer
Known Subclasses:

An HTTP server.

Nested Classes [hide private]
  ConnectionClass
The class to use for handling HTTP connections.
Instance Methods [hide private]
 
__init__(self, bind_addr, gateway, minthreads=10, maxthreads=-1, server_name=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
clear_stats(self) source code
 
runtime(self) source code
 
__str__(self)
str(x)
source code
 
_get_bind_addr(self) source code
 
_set_bind_addr(self, value) source code
 
start(self)
Run the server forever.
source code
 
error_log(self, msg='', level=20, traceback=False) source code
 
bind(self, family, type, proto=0)
Create (or recreate) the actual socket object.
source code
 
tick(self)
Accept a new connection and put it on the Queue.
source code
 
_get_interrupt(self) source code
 
_set_interrupt(self, interrupt) source code
 
stop(self)
Gracefully shutdown a server that is serving forever.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  _bind_addr = '127.0.0.1'
  _interrupt = None
hash(x)
  gateway = None
A Gateway instance.
  minthreads = None
The minimum number of worker threads to create (default 10).
  maxthreads = None
The maximum number of worker threads to create (default -1 = no limit).
  server_name = None
The name of the server; defaults to socket.gethostname().
  protocol = 'HTTP/1.1'
The version string to write in the Status-Line of all HTTP responses.
  request_queue_size = 5
The 'backlog' arg to socket.listen(); max queued connections (default 5).
  shutdown_timeout = 5
The total time, in seconds, to wait for worker threads to cleanly exit.
  timeout = 10
The timeout in seconds for accepted connections (default 10).
  version = 'CherryPy/3.3.0'
A version string for the HTTPServer.
  software = None
The value to set for the SERVER_SOFTWARE entry in the WSGI environ.
  ready = False
An internal flag which marks whether the socket is accepting connections.
  max_request_header_size = 0
The maximum size, in bytes, for request headers, or 0 for no limit.
  max_request_body_size = 0
The maximum size, in bytes, for request bodies, or 0 for no limit.
  nodelay = True
If True (the default since 3.1), sets the TCP_NODELAY socket option.
  ssl_adapter = None
An instance of SSLAdapter (or a subclass).
Properties [hide private]
  bind_addr
The interface on which to listen for connections.
  interrupt
Set this to an Exception instance to interrupt the server.

Inherited from object: __class__

Method Details [hide private]

__init__(self, bind_addr, gateway, minthreads=10, maxthreads=-1, server_name=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

Class Variable Details [hide private]

protocol

The version string to write in the Status-Line of all HTTP responses.

For example, "HTTP/1.1" is the default. This also limits the supported features used in the response.

Value:
'HTTP/1.1'

software

The value to set for the SERVER_SOFTWARE entry in the WSGI environ.

If None, this defaults to ``'%s Server' % self.version``.

Value:
None

ssl_adapter

An instance of SSLAdapter (or a subclass).

You must have the corresponding SSL driver library installed.

Value:
None

Property Details [hide private]

bind_addr

The interface on which to listen for connections.

For TCP sockets, a (host, port) tuple. Host values may be any IPv4 or IPv6 address, or any valid hostname. The string 'localhost' is a synonym for '127.0.0.1' (or '::1', if your hosts file prefers IPv6). The string '0.0.0.0' is a special IPv4 entry meaning "any active interface" (INADDR_ANY), and '::' is the similar IN6ADDR_ANY for IPv6. The empty string or None are not allowed.

For UNIX sockets, supply the filename as a string.

Get Method:
_get_bind_addr(self)
Set Method:
_set_bind_addr(self, value)

interrupt

Set this to an Exception instance to interrupt the server.

Get Method:
_get_interrupt(self)
Set Method:
_set_interrupt(self, interrupt)