Handle replies from the connection

Not yet finished.