Compress message stream and keep it alive with tcp keepalive