callback logic：connect，receive