mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Renamed the SocketServer module to 'socketserver'.
Merged revisions 63132 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r63132 | alexandre.vassalotti | 2008-05-11 22:11:22 -0400 (Sun, 11 May 2008) | 4 lines Updated all import statements to use the new socketserver module name. Renamed socketserver module in its own documentation. Renamed documentation references. ........
This commit is contained in:
parent
6f1e619b41
commit
ce261952e6
16 changed files with 63 additions and 64 deletions
|
@ -21,7 +21,7 @@ Usually, this module isn't used directly, but is used as a basis for building
|
|||
functioning Web servers. See the :mod:`SimpleHTTPServer` and
|
||||
:mod:`CGIHTTPServer` modules.
|
||||
|
||||
The first class, :class:`HTTPServer`, is a :class:`SocketServer.TCPServer`
|
||||
The first class, :class:`HTTPServer`, is a :class:`socketserver.TCPServer`
|
||||
subclass. It creates and listens at the HTTP socket, dispatching the requests
|
||||
to a handler. Code to create and run the server looks like this::
|
||||
|
||||
|
|
|
@ -1274,17 +1274,17 @@ the receiving end. A simple way of doing this is attaching a
|
|||
logger2.warning('Jail zesty vixen who grabbed pay from quack.')
|
||||
logger2.error('The five boxing wizards jump quickly.')
|
||||
|
||||
At the receiving end, you can set up a receiver using the :mod:`SocketServer`
|
||||
At the receiving end, you can set up a receiver using the :mod:`socketserver`
|
||||
module. Here is a basic working example::
|
||||
|
||||
import cPickle
|
||||
import logging
|
||||
import logging.handlers
|
||||
import SocketServer
|
||||
import socketserver
|
||||
import struct
|
||||
|
||||
|
||||
class LogRecordStreamHandler(SocketServer.StreamRequestHandler):
|
||||
class LogRecordStreamHandler(socketserver.StreamRequestHandler):
|
||||
"""Handler for a streaming logging request.
|
||||
|
||||
This basically logs the record using whatever logging policy is
|
||||
|
@ -1326,7 +1326,7 @@ module. Here is a basic working example::
|
|||
# cycles and network bandwidth!
|
||||
logger.handle(record)
|
||||
|
||||
class LogRecordSocketReceiver(SocketServer.ThreadingTCPServer):
|
||||
class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):
|
||||
"""simple TCP socket-based logging receiver suitable for testing.
|
||||
"""
|
||||
|
||||
|
@ -1335,7 +1335,7 @@ module. Here is a basic working example::
|
|||
def __init__(self, host='localhost',
|
||||
port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,
|
||||
handler=LogRecordStreamHandler):
|
||||
SocketServer.ThreadingTCPServer.__init__(self, (host, port), handler)
|
||||
socketserver.ThreadingTCPServer.__init__(self, (host, port), handler)
|
||||
self.abort = 0
|
||||
self.timeout = 1
|
||||
self.logname = None
|
||||
|
|
|
@ -20,7 +20,7 @@ XML-RPC servers written in Python. Servers can either be free standing, using
|
|||
functions that can be called by the XML-RPC protocol. The *requestHandler*
|
||||
parameter should be a factory for request handler instances; it defaults to
|
||||
:class:`SimpleXMLRPCRequestHandler`. The *addr* and *requestHandler* parameters
|
||||
are passed to the :class:`SocketServer.TCPServer` constructor. If *logRequests*
|
||||
are passed to the :class:`socketserver.TCPServer` constructor. If *logRequests*
|
||||
is true (the default), requests will be logged; setting this parameter to false
|
||||
will turn off logging. The *allow_none* and *encoding* parameters are passed
|
||||
on to :mod:`xmlrpclib` and control the XML-RPC responses that will be returned
|
||||
|
@ -50,7 +50,7 @@ SimpleXMLRPCServer Objects
|
|||
--------------------------
|
||||
|
||||
The :class:`SimpleXMLRPCServer` class is based on
|
||||
:class:`SocketServer.TCPServer` and provides a means of creating simple, stand
|
||||
:class:`socketserver.TCPServer` and provides a means of creating simple, stand
|
||||
alone XML-RPC servers.
|
||||
|
||||
|
||||
|
|
|
@ -453,7 +453,7 @@ The module :mod:`socket` exports the following constants and functions:
|
|||
|
||||
.. seealso::
|
||||
|
||||
Module :mod:`SocketServer`
|
||||
Module :mod:`socketserver`
|
||||
Classes that simplify writing network servers.
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
|
||||
:mod:`SocketServer` --- A framework for network servers
|
||||
:mod:`socketserver` --- A framework for network servers
|
||||
=======================================================
|
||||
|
||||
.. module:: SocketServer
|
||||
.. module:: socketserver
|
||||
:synopsis: A framework for network servers.
|
||||
|
||||
|
||||
The :mod:`SocketServer` module simplifies the task of writing network servers.
|
||||
The :mod:`socketserver` module simplifies the task of writing network servers.
|
||||
|
||||
There are four basic server classes: :class:`TCPServer` uses the Internet TCP
|
||||
protocol, which provides for continuous streams of data between the client and
|
||||
|
@ -213,7 +212,7 @@ server classes like :class:`TCPServer`; these methods aren't useful to external
|
|||
users of the server object.
|
||||
|
||||
.. XXX should the default implementations of these be documented, or should
|
||||
it be assumed that the user will look at SocketServer.py?
|
||||
it be assumed that the user will look at socketserver.py?
|
||||
|
||||
|
||||
.. function:: finish_request()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue