• If the following conditions apply, the Initial Wait Phase for this configured Client Service Instance shall be entered:
    如果满足以下条件,则应进入此已配置客户端服务实例的Initial Wait Phase
    • Sd_Init() has been called.
      已调用Sd_Init()
    • Sd_ClientServiceSetState() with SD_CLIENT_SERVICE_REQUESTED has been called OR SdClientServiceAutoRequired = TRUE.
      已调用状态为SD_CLIENT_SERVICE_REQUESTED的Sd_ClientServiceSetState()或SdClientServiceAutoRequired = TRUE。
    • Sd_LocalIpAddrAssignmentChg() with state “TCPIP_IPADDR_STATE_ASSIGNED” has been called for the first IpAddrId associated with the SdInstanceTxPdu.
      已为与SdInstanceTxPdu关联的第一个IpAddrId调用状态为“TCPIP_IPADDR_STATE_ASSIGNED”的Sd_LocalIpAddrAssignmentChg()。
  • When the Initial Wait Phase is entered, the API SoAd_EnableSpecificRouting() shall be called with SdClientServiceActivationRef (see SdConsumedMethods) and the relevant Socket Connections for this Client Service Instance.
    进入Initial Wait Phase后,应使用SdClientServiceActivationRef(请参阅SdConsumedMethods)和此客户端服务实例的相关套接字连接调用API SoAd_EnableSpecificRouting()。
  • When a OfferService for a required Client Service is received and SoAd_OpenSoCon()was not called before, the API SoAd_OpenSoCon() shall be called for all Socket Connections associated with this Client Service Instance.
    当收到所需客户端服务的OfferService并且之前未调用SoAd_OpenSoCon()时,API SoAd_OpenSoCon()应被调用,以满足此客户端服务实例关联的所有套接字连接的需要。
  • This Client Service Instance shall stay in the Initial Wait Phase for a time within the configured range of SdClientTimerInitialFindDelayMin and SdClientTimerInitialFindDelayMax unless an OfferService entry for this Client Service Instance is received or this random timer expires.
    此客户端服务实例应在SdClientTimerInitialFindDelayMin和SdClientTimerInitialFindDelayMax的配置范围内保持初始等待阶段一段时间,除非收到对此客户端服务实例的OfferService entry或此随机计时器到期。
  • If an OfferService Entry for this Client Service Instance is received within the Initial Wait Phase,
    如果在初始等待阶段内收到此客户服务实例的OfferService entry,
    • The calculated random timer, which has been started when entering the Initial Wait Phase, shall be canceled.
      计算的随机计时器(在进入初始等待阶段时已启动)将被取消。
    • If received TTL is not equal to the max value, set the TTL timer for this entry to the received TTL value.
      如果收到的TTL不等于最大值,请将此条目的TTL定时器设置为接收的TTL值。
    • Open TCP connection if SdClientServiceTcpRef is configured and was not opened before.
      如果配置了SdClientServiceTcpRef且之前未打开,则打开TCP连接。
    • Leave the Initial Wait Phase Enter the Main Phase.
      离开初始等待阶段进入主阶段。
  • When the calculated random timer based on the parameters SdClientTimerInitialFindDelayMin and SdClientTimerInitialFindDelayMax expires (i.e. no OfferService has been received within this timespan), the following shall be done in the following order:
    当基于参数SdClientTimerInitialFindDelayMin和SdClientTimerInitialFindDelayMax的计算随机计时器到期时(即在此时间段内未收到OfferService),应按以下顺序进行以下操作:
    • FindService Entry shall be sent.
      应发送FindService Entry
    • If the SdClientTimerInitialFindRepetitionsMax>0, enter the Repetition Phase
      如果SdClientTimerInitialFindRepetitionsMax> 0,则进入重复阶段
    • If the SdClientTimerInitialFindRepetitionsMax=0, enter the Main Phase
      如果SdClientTimerInitialFindRepetitionsMax = 0,则进入主阶段
  • If Sd_ClientServiceSetState() is called with state SD_CLIENT_SERVICE_RELEASED while being in Initial Wait Phase, this phase shall be left and the Service shall enter Down Phase.
    如果在初始等待阶段使用状态SD_CLIENT_SERVICE_RELEASED调用Sd_ClientServiceSetState(),则服务应离开此阶段并进入Down Phase。
  • If for any reasons the Initial Wait Phase is left, the calculated random timer (of the Initial Wait Phase) for this Service Instance shall be stopped.
    如果出于任何原因离开初始等待阶段,则应停止为此服务实例计算的(初始等待阶段的)随机定时器。
  • If Sd_LocalIpAddrAssignmentChg() is called with a state other than “TCPIP_IPADDR_STATE_ASSIGNED” while being in Initial Wait Phase, the Down Phase shall be entered.
    如果在初始等待阶段中调用Sd_LocalIpAddrAssignmentChg()并且状态不是“TCPIP_IPADDR_STATE_ASSIGNED”,则应进入Down阶段。
  • If the API Sd_Init() is called while being in Initial Wait Phase, the Down Phase shall be entered.
    如果在初始等待阶段调用API Sd_Init(),则应进入Down阶段。

新锦江官网