User-defined servers


The System i platform supports custom or user-defined servers. This support enables you to add custom servers and to perform administrative tasks for them, such as stopping, starting, and monitoring servers, in the same way as you administer servers that are supplied on the System i platform.

The User-Defined Servers wizard allows you to define servers to be integrated with the i5/OS® server applications. The wizard requires the following information about a user-defined server:


Accessing user-defined servers

To create, view, or manage user-defined servers in iSeries™ Navigator, follow these steps:

  1. In iSeries Navigator, expand your system > Network > Servers > User-Defined.

  2. To create a new server, right-click User-Defined and select New Server.

  3. To view or change the properties of an existing server, right-click the server and click Properties.

To add, change, or remove a user-defined server, you need input/output system configuration (*IOSYSCFG) special authority. To start or stop a user-defined server, you need all object (*ALLOBJ) special authority or specific authority to the Start TCP/IP Server (STRTCPSVR) command or the End TCP/IP Server (ENDTCPSVR) command.


Making the job appear as a server job

You can use the Change Job (QWTCHGJB) API to set the server job type for a server that is configured in iSeries Navigator. After you have configured the application's jobs to appear as server jobs, you can monitor the application's server jobs in iSeries Navigator.

Here is an example in C code of how to set the server job type using the QWTCHGJB API. The program that is used for the server or client application needs to run as a job. The Submit Job (SBMJOB) command can be used to run your client or server application.

By using the code examples, you agree to the terms of the Code license and disclaimer information.

/* Change job API - server type */
   #include <qusec.h> #include <QWTCHGJB.h> 
typedef struct jobChangeInfo {
    Qus_Job_Change_Information_t fieldNum;     Qus_JOBC0100_t format;     char data[31]; } jobChangeInfo_t; 
int main (int argc, char *argv[])
  Qus_EC_t     EcStruc;   Qus_EC_t*    PtrEcStruc;   /* iSeries structure for API errors.      */
  jobChangeInfo_t chg =      /* Job change information for QWTCHGJB    */
1,                            /* Number of variable length records.    */
46,                           /* Length of attribute information       */
1911,                         /* Key - Server Type.                    */
'C',                          /* Type of Data - Character.             */
0X40,0X40,0X40,               /* Reserved                              */
30,                           /* Length of data with server name.      */
  PtrEcStruc = &EcStruc;                 /* API error code structure.  */
  PtrEcStruc->Bytes_Provided = 16;       /* Initalize bytes provided.  */
  PtrEcStruc->Bytes_Available = 0;   /*-------------------------------------------------------------------*/
  /* API used for defining a server name in the job.                   */

The string in the second line of the following example is padded with blanks to the full 30 characters.

QWTCHGJB("*                         ",
           "                              ",
           PtrEcStruc);   if ( PtrEcStruc.Bytes_Available != 0 ) {
    printf("Error changing job server name.  Application ended.");     printf("Error message id %s sent from QWTCHGJB API.",PtrEcStruc.Exception_ID);     exit(-1);   }
  return 0; }