Add keep alive to socket

This one prevents closing sockets by external service. It happens that after 2 minutes socket is closed by remote, and there is no event connected to it. I expected to get timeout event, but it is never happened in my case.