GCM CCS Node JS connection issue after long time

I have written program to connect to Google ccs server(https://developer.android.com/google/gcm/ccs.html). The gist is available at https://gist.github.com/mseshachalam/06e685dae963c172519d

According to google documentation the connection needs to be closed after a period of time which is communicated through a message type called "control". I am running this as a supervisor process and even without receiving the connection draining message, i.e control message from google ccs server my program seems to be not receiving the messages after sometime. None of my callbacks are called because connection is not closed, ended or no error happened.

Although I don't have proper idea on different available callbacks, I have added callback on error, end, close to exit from the process so new process is spawned by supervisor.

Please guide me to find the issue. Thank you, Sesh