> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/holoscan/sdk-user-guide/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/holoscan/sdk-user-guide/_mcp/server.

# holoscan::distributed::AppDriverServer

```cpp showLineNumbers={false}
#include <holoscan/distributed/server.hpp>
```

***

## Constructors

### AppDriverServer \[#appdriverserver]

```cpp showLineNumbers={false}
holoscan::distributed::AppDriverServer::AppDriverServer(
    holoscan::AppDriver *app_driver,
    bool need_driver = true,
    bool need_health_check = false
)
```

### Destructor \[#destructor]

### \~AppDriverServer

```cpp showLineNumbers={false}
virtual holoscan::distributed::AppDriverServer::~AppDriverServer()
```

***

## Methods

### start \[#start]

```cpp showLineNumbers={false}
void holoscan::distributed::AppDriverServer::start()
```

### stop \[#stop]

```cpp showLineNumbers={false}
void holoscan::distributed::AppDriverServer::stop()
```

### wait \[#wait]

```cpp showLineNumbers={false}
void holoscan::distributed::AppDriverServer::wait()
```

### notify \[#notify]

```cpp showLineNumbers={false}
void holoscan::distributed::AppDriverServer::notify()
```

### connect\_to\_worker \[#connecttoworker]

```cpp showLineNumbers={false}
std::unique_ptr<AppWorkerClient> & holoscan::distributed::AppDriverServer::connect_to_worker(
    const std::string &worker_address
)
```

### close\_worker\_connection \[#closeworkerconnection]

```cpp showLineNumbers={false}
bool holoscan::distributed::AppDriverServer::close_worker_connection(
    const std::string &worker_address
)
```

### get\_worker\_addresses \[#getworkeraddresses]

```cpp showLineNumbers={false}
std::vector<std::string> holoscan::distributed::AppDriverServer::get_worker_addresses() const
```

### num\_worker\_connections \[#numworkerconnections]

```cpp showLineNumbers={false}
std::size_t holoscan::distributed::AppDriverServer::num_worker_connections() const
```

### run \[#run]

```cpp showLineNumbers={false}
void holoscan::distributed::AppDriverServer::run()
```

The thread function for the server thread.

***

## Member variables

| Name                 | Type                                                                    | Description                                                             |
| -------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- |
| `server_`            | `std::unique_ptr< grpc::Server >`                                       | Pointer to the gRPC server.                                             |
| `server_thread_`     | `std::unique_ptr< std::thread >`                                        | Pointer to the server thread.                                           |
| `cv_`                | `std::condition_variable`                                               | [Condition](../../../classes/condition) variable for the server thread. |
| `mutex_`             | `std::mutex`                                                            | Mutex for the server thread.                                            |
| `join_mutex_`        | `std::mutex`                                                            | Mutex for the join function.                                            |
| `should_stop_`       | `bool`                                                                  | Whether the server should stop.                                         |
| `app_driver_`        | `holoscan::AppDriver *`                                                 | Pointer to the application driver.                                      |
| `need_driver_`       | `bool`                                                                  | Whether to run the application in driver mode.                          |
| `need_health_check_` | `bool`                                                                  | Whether to check the health of the application.                         |
| `worker_clients_`    | `std::unordered_map< std::string, std::unique_ptr< AppWorkerClient > >` | [Map](../../../classes/map) of worker addresses to worker clients.      |