Package wsgitools :: Package scgi :: Module asynchronous :: Class SCGIServer
[hide private]
[frames] | no frames]

Class SCGIServer

source code


SCGI Server for WSGI applications. It does not use multiple processes or multiple threads.

Instance Methods [hide private]
 
__init__(self, wsgiapp, port, interface='localhost', error=<epydoc.docintrospecter._DevNull object>, maxrequestsize=None, maxpostsize=None, blocksize=None, config={}, reusesocket=None) source code
 
handle_accept(self)
asyncore interface
source code
 
run(self)
Runs the server.
source code

Inherited from asyncore.dispatcher: __getattr__, __repr__, __str__, accept, add_channel, bind, close, connect, create_socket, del_channel, handle_close, handle_connect, handle_connect_event, handle_error, handle_expt, handle_expt_event, handle_read, handle_read_event, handle_write, handle_write_event, listen, log, log_info, readable, recv, send, set_reuse_addr, set_socket, writable

Class Variables [hide private]

Inherited from asyncore.dispatcher: accepting, addr, closing, connected, connecting, debug, ignore_log_types

Method Details [hide private]

__init__(self, wsgiapp, port, interface='localhost', error=<epydoc.docintrospecter._DevNull object>, maxrequestsize=None, maxpostsize=None, blocksize=None, config={}, reusesocket=None)
(Constructor)

source code 
Parameters:
  • wsgiapp - is the wsgi application to be run.
  • port (int) - is an int representing the TCP port number to be used.
  • interface (str) - is a string specifying the network interface to bind which defaults to "localhost" making the server inaccessible over network.
  • error - is a file-like object being passed as wsgi.error in the environ parameter defaulting to stderr.
  • maxrequestsize (int) - limit the size of request blocks in scgi connections. Connections are dropped when this limit is hit.
  • maxpostsize (int) - limit the size of post bodies that may be processed by this instance. Connections are dropped when this limit is hit.
  • blocksize (int) - is amount of data to read or write from or to the network at once
  • config ({}) - the environ dictionary is updated using these values for each request.
  • reusesocket (None or socket.socket) - If a socket is passed, do not create a socket. Instead use given socket as listen socket. The passed socket must be set up for accepting tcp connections (i.e. AF_INET, SOCK_STREAM with bind and listen called).
Overrides: asyncore.dispatcher.__init__

handle_accept(self)

source code 

asyncore interface

Overrides: asyncore.dispatcher.handle_accept

run(self)

source code 

Runs the server. It will not return and you can invoke asyncore.loop() instead achieving the same effect.