public bool Init(string _url, UInt64 _server_id, string _token, SDClientCbFunc _cb_func = null) { url = "http://" + _url; server_id = _server_id; token = _token; cb_func = _cb_func; Log.Info("[SDClient] Http Client Init Ok"); timer_register.AddRepeatTimer((UInt32)TimerID.SERVICEDISCOVERY_UPD_TIMER_ID, (long)TimerDelay.SERVICEDISCOVERY_UPD_TIMER_DELAY, "ServiceDiscoveryClient-SendHttpReq", send_service_discovery_req); return(true); }
public bool Init(string _host, UInt32 _port, UInt64 _server_id, string _token, SDClientCbFunc _cb_func = null) { ssclient_session_mgr.Init(); host = _host; port = _port; server_id = _server_id; token = _token; cb_func = _cb_func; session_id = ssclient_session_mgr.Connect(host, port, new SDServerSession(), new Coder()); timer_register.AddRepeatTimer((UInt32)TimerID.SD_CLIENT_SEND_REQ_TIMER_ID, (long)TimerDelay.SD_CLIENT_SEND_REQ_TIMER_DELAY, "ServiceDiscoveryClient-SendReq", send_service_discovery_req); timer_register.AddRepeatTimer((UInt32)TimerID.SD_CLIENT_RECONNECT_TIMER_ID, (long)TimerDelay.SD_CLIENT_RECONNECT_TIMER_DELAY, "ServiceDiscoveryClient-Reconnect", check_reconnect); return(true); }