Closed dy5function closed 3 years ago
I think I found the problem already by myself: The tcp-server.py script closes the connection after receiving the first message from bhnet.py which is intended behavior I guess... I am sorry for raising this issue prematurely...
I am fine with closing this issue, sorry again!
https://github.com/EONRaider/blackhat-python3/blob/86d067db54b37d12ec2cf4204e7458fc5b6c0fb0/chapter02/bhnet.py#L148
Description
An exception occurs in chapter02/bhnet.py in the function client_sender on the second call to client.send() in the sender while-loop. The exception due to a broken pipe.
Reproduction Steps
The bug was found by running chapter02/tcp-server.py and connecting to it with chapter02/bhnet.py:
On the server side:
Note that the outer while-loop (line 128 - 148) is run through twice after the initial successful sending of the buffer to the server but without ever sending data again. The expected behavior is that "Test1" would be sent to the server at the end of one loop cycle and "Test2" would be sent at the end of the next loop cycle. However, the server never receives even "Test1".