You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is what the documentation says about socket.send(...):
socket.send(bytes[, flags])
Send data to the socket. The socket must be connected to a remote socket. The optional flags argument has the same meaning as for recv() above. Returns the number of bytes sent. Applications are responsible for checking that all data has been sent; if only some of the data was transmitted, the application needs to attempt delivery of the remaining data. https://docs.python.org/3.6/library/socket.html
At this moment, if send(...) fails, only a part of the message is transmitted. Which will create strange bugs.
A better solution is to use socket.sendall(...) or as the example shows:
* Fix: ip instrument log empty responce
As I understand it that is a sign of a closed socket
This should probably be an error in the future
* Use sendall fixes#748
I was browsing the instruments code and found out that in the
IPInstrument
class thesocket.send(...)
function is implemented wrongly:This is what the documentation says about
socket.send(...)
:At this moment, if
send(...)
fails, only a part of the message is transmitted. Which will create strange bugs.A better solution is to use
socket.sendall(...)
or as the example shows:https://docs.python.org/3.6/howto/sockets.html#socket-howto
The text was updated successfully, but these errors were encountered: