wearefractal/pulsar — pull request #3 by bitmage (2013-02-22 22:10:20+00:00)
Title: Call ready and close callbacks only once

There's a lot of noise in the diffs, but the changes are pretty simple. I changed two instances of 'on' to 'once'. I removed the debug statements from master, but they remain in a separate branch called logging... you might find it useful or informative. Here's a sample output from the reconnect test. The #'s at the beginning of the line are a unique ID for the channel. Bear in mind this is with the changes to pulsar integrated as well. Before that, calling disconnect() followed by destroy() on the server would cause an unhandled exception.

0: new channel (server)
1: new channel (client)
0: Received join. There are 1 listeners on test.
0: sending unjoin to 0 listeners
destroyed server
2: new channel (server)
client attempting reconnect on port: 8232
reconnected
2: Received join. There are 1 listeners on test.
1: sending ping to undefined listeners
1: sending ping to socket
2: sending ping to 1 listeners
got ping sending pong
2: sending pong to 1 listeners
client received message: ping
client received message: pong