Server/client example using socket with polling in Python