# mcorest_shutdown
RT

### Prototype

        MCO_RET mcorest_shutdown(void);

### Description

> `mcorest_shutdown()` completes the work of the RESTrt web service by closing the listening network socket and releasing internal resources.

>         static void rest_loop_task(void *args)
>         {
>             MCO_RET rc;
>             mco_sock_params_t s_params;
>             mco_socket_params_init(&s_params);
>             s_params.mode = MCO_SOCK_NON_BLOCKING;

>             rc = mcorest_initialize(db_name, INTERFACE, PORT, &s_params);
>             if (rc != MCO_S_OK) {
>                 printf("ERROR: mcorest_initialize() failed: %d (%s)\n", rc, mco_strerror(rc));
>                 return;
>             }
>             printf("Starting rest on port %d...\n", PORT);
>             rc = mcorest_start();
>             if (rc != MCO_S_OK) {
>                 printf("ERROR: mcorest_start() failed: %d (%s)\n", rc, mco_strerror(rc));
>                 return;
>             }

>         mcorest_shutdown();
>         printf("REST loop task done\n");
>         }

### Return Codes

MCO_S_OK | No errors

### Files

Header file:
mcorestrt.h
Source file:
mcorestrt.c
Library:
libmcorestrt.a