HOWTO: Set Up and Run the RNR Sample Included in the Win32 SDK

ID: Q131505

The information in this article applies to:

SUMMARY

This article explains how to set up and operate the Service Registration and Resolution (RNR) sample over the TCP and SPX network protocols. The RNR sample comes with the Microsoft Win32 (SDK) versions 3.5 and 3.51. It illustrates the use of the service registration and resolution APIs.

MORE INFORMATION

How to Set Up the RNR Sample

Run rnrsetup /ADD on each client and on the server to call the SetService API with SERVICE_ADD_TYPE. This call stores the service name type, its associated GUID, and relevant addressing information for the specified name spaces in the registry path:

   \HKEY_LOCAL_MACHINE
     \CurrentControlSet
       \Control
         \ServiceProvider
           \ServiceTypes

This information is then retrieved by GetTypeByName() and GetAddressByName() calls respectively to identify the server's address.

How to Operate the RNR Sample

1. Start rnrsrv on one machine. After setting listening ports on the

   available protocols, the RNR server executes the SetService() call with
   the SERVICE_REGISTER flag to register the network service with the
   specified name spaces. For example, it enables advertising the
   EchoExample service name on the SAP protocol.

2. On the other machine, start rnrclnt using the following syntax:

   rnrclnt /?

   Usage: rnrclnt [/name:SVCNAME] [/type:TYPENAME] [/size:N]
             [/count:N]  [/rcvbuf:N] [/sndbuf:N]

    - TYPENAME is initially passed to GetTypeByName() call to return
      the GUID value. The GUID value and SVCNAME is then passed to
      GetAddressByName() to return the address of the server that
      the client can connect to. TYPENAME is defined as EchoExample
      for the RNR sample.

    - SVCNAME specifies which EchoExample server to connect to. If
      SVCNAME is specified as the server name in the Internet domain,
      the TCP protocol will be used. If SVCNAME is specified as
      EchoServer (the RNR service name advertised on SAP), the SPX
      protocol will be used.

    - The other parameters to the rnrclnt have appropriate default
      values and are self explanatory.

Additional query words:
Keywords          : kbnetwork kbAPI kbNTOS350 kbNTOS351 kbSDKPlatform kbWinsock kbGrpNet 
Issue type        : kbhowto

Last Reviewed: July 31, 1998