Click to open or copy the files for the RNRsrv sample.
This sample is a test and demonstration service for the RNR (service Registration and Name Resolution) APIs. This is a simple service designed to show the basic principles involved in using the RNR APIs to write a protocol-independent Windows Sockets service.
This service opens a number of listening sockets, waits for an incoming connection from a client, accepts the connection, then echos data back to the client until the client terminates the virtual circuit. This service is single-threaded and can handle only a single client at a time.
The OpenListeners routine implemented herein is intended to be a demonstration of RNR functionality commonly used in protocol-independent services. Service writers are encouraged to leverage this code to assist them in writing protocol-independent services on top of the Windows Sockets API.
This sample uses the following keywords:
accept; advertiseservice; bind; closesocket; enumprotocols; exit; fd_isset; fd_set; fd_zero; free; getaddressbyname; getlasterror; getsockname; gettypebyname; listen; localfree; malloc; openlisteners; printf; recv; rtlzeromemory; select; send; setlasterror; socket; wsasetservice; wsastartup