APIs by Example: Server Support APIs Providing NetServer Management Facilities

The IBM i Support for Windows Network Neighborhood, also known as IBM i NetServer, lets you access IBM i file and print resources directly from your PC through file and printer shares. This facility enables you to map IBM i file systems and directories to network drives on your PC as well as direct PC printer output to IBM i–configured printers. Information about your system’s NetServer configuration can be retrieved by using the Navigator for i interface, which also supports the associated NetServer management functions.

If you’re an API programmer, however, you also have the option of creating your own command interfaces to the NetServer configuration information and management functions. As part of the Server Support APIs, IBM provides a set of APIs offering a programming interface to IBM i NetServer functions. In today’s APIs by Example, I discuss some of these APIs and demonstrate their use in the context of four new CL commands that let you end and start the NetServer, as well as display the NetServer configuration information and NetServer connection statistics.

The End Server (QZLSENDS) API and the Start Server (QZLSSTRS) API both employ very simple parameter lists. In addition to the API error data structure that both APIs support, the only other parameter is the Reset server parameter offered by the QZLSSTRS API. The End NetServer (ENDNETSVR) and Start NetServer (STRNETSVR) commands therefore specify the APIs directly as CPPs. As demonstrated in earlier APIs by Example articles, a command definition can submit an API error data structure as a single integer set to the value zero, in turn causing the API to signal any encountered errors in the form of an exception message sent directly to the API caller.

Download the save file containing the source code.

Read the entire article.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s