MPDC: Multi Party Domain Cryptosystem 1.0.0.0b (A0)
MPDC Interior protocol
mas.h File Reference

The MPDC Application Server. More...

#include "common.h"
#include "mpdc.h"

Go to the source code of this file.

Functions

MPDC_EXPORT_API void mpdc_mas_pause_server ()
 Pause the Application server.
 
MPDC_EXPORT_API int32_t mpdc_mas_start_server ()
 Start the Application server.
 
MPDC_EXPORT_API void mpdc_mas_stop_server ()
 Stop the Application server.
 

Detailed Description

The MPDC Application Server.

The MPDC Application Server (MAS) is the primary server module in the MPDC system. It is responsible for handling secure communication, processing application-level commands, managing certificate operations, and maintaining the topology of connected nodes.

The MAS operates as part of the overall MPDC network architecture. It supports key exchange, secure message transport, and logs events to assist with debugging and diagnostics.

The functions declared herein allow an application to start, pause, and stop the MAS. These control functions are typically called by the main application to manage the server's lifecycle.

Note
It is essential that the MAS be properly configured before starting. Certificate files, network settings, and key materials must be available and correct.

Example usage:

// Start the MAS and check for success.
{
// Server is running; enter command loop or perform other tasks.
}
else
{
// Handle startup error.
}
// To pause the server:
mpdc_mas_pause_server();
// To fully stop the server:
mpdc_mas_stop_server();
MPDC_EXPORT_API int32_t mpdc_mas_start_server()
Start the Application server.
Definition mas.c:2496

Function Documentation

◆ mpdc_mas_pause_server()

MPDC_EXPORT_API void mpdc_mas_pause_server ( )

Pause the Application server.

This function suspends the MAS command loop and stops processing new connections. It is useful when temporary suspension of server activity is required without fully shutting down the service.

Note
While paused, the MAS will not accept new connections until resumed or restarted.

◆ mpdc_mas_start_server()

MPDC_EXPORT_API int32_t mpdc_mas_start_server ( )

Start the Application server.

This function initializes the MAS environment, including:

  • Setting up the console (virtual terminal, window size, title).
  • Loading configuration data and certificates.
  • Initializing secure sockets and key exchange mechanisms.
  • Starting the main command loop for server operations.
Returns
Returns 0 on successful startup; a negative error code otherwise.
Note
A return value of zero indicates that the MAS is ready to accept client connections. Any non-zero return value signifies a failure, possibly due to configuration issues, missing certificates, or insufficient system resources.

◆ mpdc_mas_stop_server()

MPDC_EXPORT_API void mpdc_mas_stop_server ( )

Stop the Application server.

This function terminates all active server operations and releases resources. It stops the command loop, closes all open network connections, and writes any final log entries before shutting down.

Note
After stopping, the MAS can be restarted by calling mpdc_mas_start_server().