| Trees | Indices | Help |
|
|---|
|
|
The primitives defined by this module are designed to be used in conjunction with the asynchronous dispatch api offered by asycamore.dispatcher
Consists of write_iterable and data_reader used in conjunction with
asycamore.httpclientsocket.HTTPClientSocket. And connect_tcp used in
conjunction with asycamore.dispatcher
Consists of listen_tcp, server_accept and the class AcceptingSocket,
| Classes | |
|
AcceptingSocket A minimalist instance for managing an accepting server socket. |
|
| Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
| Function Details |
Initiate a nonblocking tcp connect. If the connection attempt is successfully intiated For a succesfull connection result[0] is one of 0, socket.EINPROGRESS. If result[0] == 0 it means the connection was established immediately, in this case it is the callers responsibility to deal with this. At the least the caller should simulate the connection event by invoking: o.dispatch_event((True, False, None)) As o.dispatch_state is initialised by this function, all dispatch_event implementations can trivialy deal with this scenario. Most will need to take no special action. Those implementations that need to care about specific event flags or values for the Read, Write, Exceptional fields of the event can distinguish immediate connect as: R is True and W is False and E is None If the target host is on the same machine it is normal for the connect to complete immediately. The chosen value for the event flagging immediate connect is derived from following information from p 448 Unix Network Programming v1
|
Provides a just call me with the data interface to socket reading Similar to write_iterable in behaviour and use but much simpler. This
function is used by client connection states to provide a call back
interface for consuming data read from a socket. |
create and initialise a listening server socket.
While we should be able to rely on select to be authoratative with regard to readability, making setblocking(0) redundant for a listening socket, we cant according to: p463 UNP v1. |
Accepts a connection on the socket associated with serverstate. Then:
connection_factory(sock, serverstate, connection_closer)
|
yield up to buffer size bytes on each iteration. If an operation would block, yield |
Iterative driver for sending data to a socket. Used by the implementation of write_iterable. Properly detects exceptional events and returns for any other than EINTR, EWOULDBLOCK, EAGAIN and ENOBUFFS. Note: The value for EWOULDBLOCK is assumed to be numericaly equal to EAGAIN. For posix systems this is reliable. |
A client focused api for sending discrete data items to a socket. Instances of this generator are typicaly used to insulate client document
processing facilities from the detailed semantics of responding to events
produced by the asycamore.dispatcher Each The client program main loop will arrange to create a connection that will
instantiate this generator iterator with the connection state instance as
the Clients will typically be using
Once a connection is established that connection will drive the
write_iterable instance by sending in the events it receives in its
If the boolean The A
if not before_send or after_send:
nsent += 1
elif before_send:
print 'about to start sending %s' % d
elif after_send:
print 'started sending %d' % d
Example uses can be found in asycamore.httpclient, and, in particular,
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Tue May 8 00:56:10 2007 | http://epydoc.sourceforge.net |