Fix python3 error
Add client socket keepalive