Skip to content
Advertisement

Tag: nonblocking

Python non-blocking socket

Hi I am trying to create a very simple peer-to-peer chatting program in python. The first user can runs the server.py program below to bind to a socket. Then another user can use netcat to connect to the server and communicate. However, the program is only able to get the user’s input and send to the other side. The user

Why does this function block?

I have some code that is reading data (if there is any) from a non-blocking socket and printing it, but somehow when this happens (data is received & printed) the function then blocks and does not return unless I kill the sending process (which also uses a non-blocking stream to send the data). Obviously I have done something wrong but

Advertisement