Click to open or copy the files for the RNRclnt sample.
This sample is a client for the RNR (service Registration and Name Resolution) APIs. This is a simple client application designed to show the basic principles involved in using the RNR APIs to write a protocol-independent Windows Sockets client application.
This client works by examining the protocols loaded on the machine, looking for protocols which are reliable and stream-oriented. Then it attempts to locate and connect to the service on these protocols. When is has successfully connected to the service, it exchanges several messages with the service and then terminates the connection.
The OpenConnection routine implemented herein is intended to be a demonstration of RNR functionality commonly used in protocol-independent clients. Application writers are encouraged to leverage this code to assist them in writing protocol-independent applications on top of the Windows Sockets API.
This sample uses the following keywords:
_strnicmp; atoi; bind; closesocket; connect; doecho; enumprotocols; exit; getaddressbyname; getlasterror; getnamebytype; gettickcount; gettypebyname; localalloc; localfree; malloc; openconnection; printf; recv; rnr20_getaddressbyname; rtlcopymemory; rtlzeromemory; send; setlasterror; socket; strcmp; wsagetlasterror; wsalookupservicebegin; wsalookupserviceend; wsalookupservicenext; wsastartup