adds connection timeout
adds support for pub/sub
adds examples