ampy.py can not detect the socket closed when amp server is down.
Bug #1207618 reported by
spikeekips
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ampy |
New
|
Undecided
|
Unassigned |
Bug Description
Hi, developers.
`ampy.py` does not check the socket is closed by the server-side like server is shutdown. When the server is shutdown, `sock.recv` in ampy.py still try to receive, but the data is 0 bytes. I attached my patch.
Thanks.
To post a comment you must log in.
Hi spikeekips,
Thank you for your patch! I intent to work on revamping Ampy in the near future to use asyncio instead of asyncore since asyncore is such a piece of junk by comparison. Possibly using a bundled version of https:/ /pypi.python. org/pypi/ trollius - the point of ampy is to be a chunk of python code you can grab and quickly have a pure-python + stdlib amp client and server.
Outside of those requirements you should just use Twisted implementation.