3.1.5.2.11 Receive SYNC_END

The SYNC_END message is sent by the connection responder when it has completed the requested synchronization process.

If the message fails to conform to any of the following conditions, then the message MUST be discarded unprocessed and the connection MUST be terminated.

  • The Message Size MUST be at least 0x0C.

If the message is received when the connection is not in the LINK_STATE_CONNECTED state, or the connection Sync State is set to NONE, the message MUST be ignored.

If a SYNC_END message is received with Final flag set and the connection SYNC_TYPE is SYNC_HASH, the receiving node MUST perform the following steps:

  • The local node MUST send (see section 3.1.7.1) a FLOOD message for each record in the list of Records To Send (see section 3.1.7.31). Each FLOOD message MUST be constructed as specified in section 2.2.2.11.

  • If the Defer Expiration flag is set to true, the local node MUST initialize the Record Expiration Timer to expire in 0 seconds.

If a SYNC_END message is received with the Final bit set and the connection's SYNC_TYPE is SYNC_TIME or SYNC_NEW, the receiving node MUST perform the following steps:

  • Set the Connection Sync Type state to NONE.

  • If for this connection, Current Sync Record Type has a non-null value and All Record Types Synched is set to FALSE, the receiving node MUST:

    • Select the Record Type from the Sync Record Types array pointed to by this connection's Current Sync Record Type pointer (see section 3.1.7.29 for initialization of this array and pointer).

    • Send (see section 3.1.7.1) a SOLICIT_TIME or SOLICIT_NEW message (to match the connection's SYNC_TYPE) for the selected Record Type in the array:

      • In the case of a SOLICIT_TIME message, the Modification Time MUST be set to the peer time at which the node left the graph (based on the persisted Peer Time Delta; see section 3.1.4.2).

      • Inclusion Count MUST be 1.

      • Exclusion Count MUST be 0.

      • Record Types Array MUST contain one entry containing the GUID of the selected Record Type.

    • Update Current Sync Record Type for this connection, to point to the next Record Type in the Record Types array (or to have a null value if there are no more Record Types in the array).

  • If for this connection, Current Sync Record Type has a null value, and All Record Types Synched is set to FALSE, the local Node MUST:

    • Set All Record Types Synched to TRUE for this connection.

    • Send (see section 3.1.7.1) a SOLICIT_TIME or SOLICIT_NEW message (to match the current value of SYNC_TYPE) for all remaining records:

      • In the case of a SOLICIT_TIME message, Modification Time MUST be set to the peer time at which the node left the graph.

      • Inclusion count MUST be 0.

      • Exclusion count MUST be 2 + the number of elements in the Prioritized Record Types array.

      • Record Types Array MUST contain one entry for the Graph Info Record type, one entry for the Presence Record type, and one entry for each element of the Prioritized Record Type array.

  • If All Record Types Synched is set to TRUE for this connection, the local node MUST set SYNC_TYPE for this connection to NONE, and in addition, if the Defer Expiration flag is set to TRUE, initialize the Record Expiration Timer to expire in 0 seconds.

If the SYNC_END is received and the Final flag is not set, the message MUST be ignored.