X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=python%2Fashd%2Fproto.py;h=8dc5ecd133c2ff63cd54978e7879fa809d843010;hb=0bf0720d9d585a56904081d0c8a71507d8889adf;hp=92a21cad49300e9699f853fa14c2b5c23f52748b;hpb=2baf419bbc450cea45029f0c02d329c6a7041f34;p=ashd.git diff --git a/python/ashd/proto.py b/python/ashd/proto.py index 92a21ca..8dc5ecd 100644 --- a/python/ashd/proto.py +++ b/python/ashd/proto.py @@ -10,6 +10,8 @@ ashd.util module provides an easier-to-use interface. import os, socket import htlib +__all__ = ["req", "recvreq", "sendreq"] + class protoerr(Exception): pass @@ -114,10 +116,11 @@ def recvreq(sock = 0): The returned value is an instance of the `req' class. As per its description, care should be taken to close() the request when - done, to avoid leaking response sockets. + done, to avoid leaking response sockets. If end-of-file is + received on the socket, None is returned. - This function may either raise on OSError if an error occurs on - the socket, or a ashd.proto.protoerr if the incoming request is + This function may either raise an OSError if an error occurs on + the socket, or an ashd.proto.protoerr if the incoming request is invalidly encoded. """ data, fd = htlib.recvfd(sock)