Add onConnect/onDisconnect callbacks