-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect transport closing #197
Comments
That sounds like a good change. |
komuw
added a commit
that referenced
this issue
Feb 18, 2020
What: - During shutdown, close the writer & not reader end of the transport protocol Why: - Fixes: #197 - `naz.Client.writer.close()` also closes the transport, on which both the `naz.Client.writer` and `naz.Client.reader` are based on. This means that the reader is also closed. This may not be what we want. When we call `naz.Client.shutdown()` we want to close the writer, however; we want to still be able to read. This is because the SMSC may still send the `UNBIND_RESP` and we want to receive it
This was referenced Sep 18, 2020
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python 3.8.1
naz 0.7.8
MacOS 10.15.3
Hi, I found problem with
Client.shutdown
method. It causesasyncio.exceptions.IncompleteReadError: 0 bytes read on a total of 16 expected bytes
every time I call it.Here is the code to reproduce the problem:
Step to reproduce:
Output
This line causes the error
naz/naz/client.py
Line 1726 in 10e44b1
But I think the real reason is here
naz/naz/client.py
Line 2318 in 10e44b1
Python documentation says that this method also closes TCP socket https://docs.python.org/3/library/asyncio-stream.html#asyncio.StreamWriter.close
And that, as I think, causes
asyncio.exceptions.IncompleteReadError
.Instead of
writer.close()
there could bewriter.write_eof
, which only closes writer, but reader still can receive data.https://docs.python.org/3/library/asyncio-stream.html#asyncio.StreamWriter.write_eof
The text was updated successfully, but these errors were encountered: