interface: PaddedRSTransport: keep in sync with e-x: flush on close
ref f62f986b33
note: ReplyAndDisconnect is specific to electrumx, however I think the name is descriptive enough to keep it here.
This commit is contained in:
@@ -428,6 +428,13 @@ class PaddedRSTransport(RSTransport):
|
|||||||
# No polling here, we always force-empty the buffer.
|
# No polling here, we always force-empty the buffer.
|
||||||
self._force_send = True
|
self._force_send = True
|
||||||
|
|
||||||
|
async def close(self, *args, **kwargs):
|
||||||
|
'''Close the connection and return when closed.'''
|
||||||
|
# Flush buffer before disconnecting. This makes ReplyAndDisconnect work:
|
||||||
|
self._force_send = True
|
||||||
|
self._maybe_consume_sbuffer()
|
||||||
|
await super().close(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class ServerAddr:
|
class ServerAddr:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user