[Zope3-checkins] CVS: Zope3/src/zope/server/interfaces -
__init__.py:1.3
Stephan Richter
srichter at cosmos.phy.tufts.edu
Mon Feb 16 16:34:40 EST 2004
Update of /cvs-repository/Zope3/src/zope/server/interfaces
In directory cvs.zope.org:/tmp/cvs-serv5858/src/zope/server/interfaces
Modified Files:
__init__.py
Log Message:
Updated doc strings. Added documentation where necessary.
=== Zope3/src/zope/server/interfaces/__init__.py 1.2 => 1.3 ===
--- Zope3/src/zope/server/interfaces/__init__.py:1.2 Wed Dec 25 09:15:26 2002
+++ Zope3/src/zope/server/interfaces/__init__.py Mon Feb 16 16:34:39 2004
@@ -15,11 +15,9 @@
$Id$
"""
-
from zope.interface import Interface
from zope.interface import Attribute
-
class ISocket(Interface):
"""Represents a socket.
@@ -27,52 +25,58 @@
Reference.
"""
- def listen(num):
- """Listen for connections made to the socket. The backlog argument
- specifies the maximum number of queued connections and should
- be at least 1; the maximum value is system-dependent (usually
- 5).
+ def listen(backlog):
+ """Listen for connections made to the socket.
+
+ The 'backlog' argument specifies the maximum number of queued
+ connections and should be at least 1; the maximum value is
+ system-dependent (usually 5).
"""
def bind(addr):
- """Bind the socket to address. The socket must not already be bound.
+ """Bind the socket to address.
+
+ The socket must not already be bound.
"""
def connect(address):
- """Connect to a remote socket at address.
- """
+ """Connect to a remote socket at address."""
def accept():
- """Accept a connection. The socket must be bound to an address and
- listening for connections. The return value is a pair (conn,
- address) where conn is a new socket object usable to send and
- receive data on the connection, and address is the address
- bound to the socket on the other end of the connection.
+ """Accept a connection.
+
+ The socket must be bound to an address and listening for
+ connections. The return value is a pair (conn, address) where conn is
+ a new socket object usable to send and receive data on the connection,
+ and address is the address bound to the socket on the other end of the
+ connection.
"""
def recv(buffer_size):
- """Receive data from the socket. The return value is a string
- representing the data received. The maximum amount of data
- to be received at once is specified by bufsize. See the
- Unix manual page recv(2) for the meaning of the optional
- argument flags; it defaults to zero.
+ """Receive data from the socket.
+
+ The return value is a string representing the data received. The
+ maximum amount of data to be received at once is specified by
+ bufsize. See the Unix manual page recv(2) for the meaning of the
+ optional argument flags; it defaults to zero.
"""
def send(data):
- """Send data to the socket. The socket must be connected to a
- remote socket. The optional flags argument has the same
- meaning as for recv() above. Returns the number of bytes
- sent. Applications are responsible for checking that all
- data has been sent; if only some of the data was
- transmitted, the application needs to attempt delivery of
- the remaining data.
+ """Send data to the socket.
+
+ The socket must be connected to a remote socket. The optional flags
+ argument has the same meaning as for recv() above. Returns the number
+ of bytes sent. Applications are responsible for checking that all data
+ has been sent; if only some of the data was transmitted, the
+ application needs to attempt delivery of the remaining data.
"""
def close():
- """Close the socket. All future operations on the socket
- object will fail. The remote end will receive no more data
- (after queued data is flushed). Sockets are automatically
- closed when they are garbage-collected.
+ """Close the socket.
+
+ All future operations on the socket object will fail. The remote end
+ will receive no more data (after queued data is flushed). Sockets are
+ automatically closed when they are garbage-collected.
"""
@@ -91,7 +95,7 @@
while for its turn.
"""
- def shutdown(cancel_pending=1, timeout=5):
+ def shutdown(cancel_pending=True, timeout=5):
"""Shuts down all handler threads and may cancel pending tasks.
"""
@@ -285,8 +289,9 @@
class IServerChannel(Interface):
- parser_class = Attribute("Subclasses must provide a parser class")
- task_class = Attribute("Subclasses must provide a task class.")
+ parser_class = Attribute("""Subclasses must provide a parser class""")
+ task_class = Attribute("""Specifies the ITask class to be used for
+ generating tasks.""")
active_channels = Attribute("Class-specific channel tracker")
next_channel_cleanup = Attribute("Class-specific cleanup time")
More information about the Zope3-Checkins
mailing list