HttpConnect.onClose and onError are added to use Stream for invoking onClose and onError callbacks