derekcollison/nats — pull request #41 by nomoto-1 (2012-06-11 06:31:55+00:00)
Title: client would be disconnected when reconnecting to un authorized server

When a correct client reconnects to un authorized server, the server disconnects the client in some cases.
The server gives AUTH_REQUIRED error because the client sends messages, for example, created by add_periodic_timer method before the server recieves CONNECT message.

Modified client as follows.
・clear pending messages at unbind.
・don't add a message except CONNECT message to pending messages while reconnecting.

Added a test.
・publish a message without error even if reconnected to un authorized server.