3.1.5.1 MTAG_DISCONNECT (MsgTag 0x00000001)

When an MTAG_DISCONNECT message is received over a session, the MSDTC Connection Manager: OleTx Multiplexing Protocol (CMP) implementation MUST look at the dwConnectionId field of the MsgHeader field of the message, and retrieve the Connection object (section 3.1.7.1) with the matching Connection ID from the Incoming Connection Table of the Session object. If no such Connection object exists, the MTAG_DISCONNECT message MUST be silently ignored.

Otherwise, the higher-layer protocol MUST be notified of the Connection Disconnected (section 3.1.7.4.2) event by signaling this event using the Incoming Message Notification Interface as described in section 3.1.1.1, and the CMP implementation MUST remove the Connection object from the Incoming Connection Table of the Session object. If both the Incoming Connection Table and the Outgoing Connection Table of the Session object are now empty, the Idle Timer MUST be started.

The CMP implementation MUST then allocate a new MTAG_DISCONNECTED message, set the dwUserMsgType field of the MsgHeader field to the connection type of the Connection object, and set the dwConnectionId field of the MsgHeader to the Connection ID of the Connection object. Finally, the message MUST be enqueued on the Session object as specified in section 3.1.7.1.