Home | Trees | Indices | Help |
---|
|
object --+ | sock
Coro socket object.
This is typically used for network sockets, but can also be used for coro-safe IO on any file descriptor that supports kqueue non-blocking operations.
The constructor takes the following parameters:
|
|||
|
|||
a new object with type S, a subtype of T |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
domain : The socket domain (AF_INET, AF_UNIX, AF_UNSPEC). |
|||
fd : The file descriptor number. |
|||
orig_fd : The original file descriptor number. |
|||
stype : The socket type (SOCK_STREAM, SOCK_DGRAM) |
|
|||
Inherited from |
|
|
|
|
|
Accept multiple connections. This will accept up to
|
|
Close the socket. It is safe to call this if the socket is already closed.
|
|
|
|
|
|
|
|
|
Return a regular file object corresponding to the socket. The mode and bufsize arguments are as for the built-in open() function. The underlying socket is duplicated via sock.dup to emulate Python's reference counting behavior.
|
Read data. This is an alias for the recv method. |
Read a vector array of data. This will repeatedly call readv until all data is received. If the end of the stream is reached before all data is received, then the result tuple will only contain the elements competely or partially received.
|
Receive data. This may return less data than you request if the socket buffer is not large enough. Use recv_exact to ensure you receive exactly the amount requested.
|
Receive exactly the number of bytes requested. This will repeatedly call read until all data is received.
|
Receive data into a Python buffer. This is for the Python buffer interface. If you don't know what that is, move along. This method is for Python socket compatibility.
|
Receive data. This may return less data than you request if the socket buffer is not large enough.
|
Receive data into a Python buffer. This is for the Python buffer interface. If you don't know what that is, move along. This method is for Python socket compatibility.
|
Send data on the socket. This will repeatedly call write to ensure all data has been sent. This will raise OSError if it is unable to send all data.
|
Send all data. This is an alias for the send method. |
|
|
|
Block until the socket is readable. This will block until there is data available to be read.
|
Block until the socket is writeable. This will block until it is possible to write to the socket.
|
Write data. This is an alias for the send method. |
Write a vector array of data. This will repeatedly call writev until all data is sent. If it is unable to send all data, it will raise an OSError exception.
|
|
fd: The file descriptor number. Set to -1 when the socket is closed. |
orig_fd: The original file descriptor number. This is left for debugging purposes to determine which file descriptor was in use before the socket was closed. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Feb 16 18:06:44 2012 | http://epydoc.sourceforge.net |