Rediger

Del via


Network Module Attachment

Before a client module and a provider module can be attached to one another, they each must register themselves with the NMR. A client module registers with the NMR by calling the NmrRegisterClient function and a provider module registers with the NMR by calling the NmrRegisterProvider function. The following diagram illustrates network module registration.

Diagram showing the process of network module registration.

If the client module and the provider module both specify the same Network Programming Interface (NPI) when they register with the NMR, the NMR will initiate attaching the two network modules together. The NMR initiates the attachment process by calling the client module's ClientAttachProvider callback function. The following diagram illustrates the Network Module Registrar (NMR) initiating the attachment.

Diagram depicting the NMR initiating the attachment process.

A client module's ClientAttachProvider callback function can examine the registration data for the provider module to determine if it will attach to the provider module. If the client module determines that it will attach to the provider module, it continues the attachment process by calling the NmrClientAttachProvider function. When a client module calls the NmrClientAttachProvider function, the NMR in turn calls the provider module's ProviderAttachClient callback function. The following diagram illustrates the client module continuing the attachment.

Diagram demonstrating the client module proceeding with the attachment process.

A provider module's ProviderAttachClient callback function can examine the registration data for the client module to determine if it will attach to the client module. If the provider module determines that it will attach to the client module, the provider module and client module exchange pointers to their respective NPI dispatch table structures. After the client module and provider module are attached, they can interact with each other through their NPI functions independent of the NMR. The following diagram illustrates the network modules attached.

Diagram displaying the attached network modules after successful attachment.