If I had an open connection to a channel and then shutdown the PubNub object, does the connection close?

The answer to the question depends on the API in use. For Java and C#, the connections are closed once the object memory is freed. However, with a client that doesn't control the connection, like JavaScript, the browser will keep the connection open for a period of time after it becomes inactive.