+ to handle more error case, when connection failed, when connection closed, and defer the message delivery till 'ready'
Merge pull request #14 from inexplicable/master

fixed an issue when the client sends message earlier than the server registers the 'message' callback