# Shutting down by using the API

You can use the NetworkServerControl API to shut down the Network Server from within a Java application. For example:

    shutdown();

For example, the following command shuts down the Network Server running on the current machine using port 1527.

    NetworkServerControl server = new NetworkServerControl();
    server.shutdown();

Parent topic: Shutting down the Network Server
Related tasks
Shutting down by using the command line