Refactor iohandler interface and fix a null pointer error.
Add param to session close method.
Add register client message.