make NGInputStream public so that it can be used in integration tests
Immediately call clientDisconnect if addClientListener is called after client disconnection, expose parts of NGContext and NGInputStream to allow integration tests