nucm-logo

NUCM-2.0 Documentation
Interface: Miscellaneous: nc_shutdown


[Distribution | Miscellaneous | Access]

[nc_ping | nc_shutdown]

Signature

int  nc_shutdown(const t_server*  server)

Functionality

Shuts down the NUCM server addressed by the parameter server. The server is not shut down until all pending requests have been served. However, no new requests are accepted.

Return Values

0: everything went ok
-1: an error occurred

NdbErrno Codes

NdbOk :everything went ok
NdbConnect :the server is down or not reachable
NdbComm :a communication error occurred
NdbProtocol:a failure occurred in the NUCM protocol
NdbNotAvail:service is not available

Example

Assuming an access server is active on a machine "serl.cs.colorado.edu" and is listening to port "1234". To deactivate the server, the following code fragment can be used:
   #include "nc.h"

   t_server  server;

   strcpy(server.host, "serl.cs.colorado.edu");
   sprintf(server.port, "%d", NUCM_PORT);
   nc_shutdown(&server);
Note that port "1234" is the default port a NUCM access server listens to, so we use the NUCM_PORT macro to set it in the variable server.

[Top | Quick Index] [Concepts | Interface]

SERL <serl.cs.colorado.edu>