When does s.sendall block a thread/process in python?
s.sendall(a'') in python is used to send the data to the socket. The socket must be connected to a remote socket. But if the user does not have any data to send so the sendall() does nothing during the function is called.
since, The recv()
method receives
up to buffersize bytes from the socket. and if no data is send
through the sendall function so there is no data to recieve call on
the client blocks waiting for the data.
it blocks until at least one byte is available or until the remote end is closed. When the remote end is closed and all data is read, it returns an empty byte string.
Get Answers For Free
Most questions answered within 1 hours.