implement an input stream for handling messages from the server