> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# server:grpc start server

**Version: 0.0.0**

## Description

Starts a dpf's grpc server (if local) or connect to one and keep it waiting for requests in a streams.

## Inputs

This table lists the input pins for this operator. Input pins define the data that the operator requires to perform its operation.
Some inputs are required, while others are optional and provide additional configuration.
Each parameter is detailed in the sections that follow the table.

| Pin number | Name | Status | Expected type(s) |
| - | - | - | - |
| **0** | [ip](#input_0) | | [`string`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types) |
| **1** | [port](#input_1) | | [`string`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types), [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types) |
| **2** | [starting\_option](#input_2) | | [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types) |
| **3** | [should\_start\_server](#input_3) | | [`bool`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types) |
| **4** | [data\_sources](#input_4) | | [`data_sources`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#data-sources) |
| **5** | [dpf\_context](#input_5) | | [`string`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types), [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types) |

### ip (Pin 0)

* **Required:** No
* **Expected type(s):** [`string`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types)

If no ip address is put, the local ip address is taken

### port (Pin 1)

* **Required:** No
* **Expected type(s):** [`string`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types), [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types)

If no port is put, port 50052 is taken

### starting\_option (Pin 2)

* **Required:** No
* **Expected type(s):** [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types)

default is 1 that starts server in new thread. With 0, this thread will be waiting for grpc calls and will not be usable for anything else. With 2, it the server will be started in a new process.

### should\_start\_server (Pin 3)

* **Required:** No
* **Expected type(s):** [`bool`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types)

If true, the server is assumed to be local and is started. If false, only a client (able to send grpc calls) will be started

### data\_sources (Pin 4)

* **Required:** No
* **Expected type(s):** [`data_sources`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#data-sources)

A data source with result key 'grpc' and file path 'port:ip' can be used instead of the input port and IP.

### dpf\_context (Pin 5)

* **Required:** No
* **Expected type(s):** [`string`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types), [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types)

This pin is associated with pin(2) = 2 (server started in a new process). User can enter the integer associated with a DPF context (1: Standalone Context - DpfCoreStandalone.xml, 3: Custom - DpfCustomDefined.xml) or a string with the path of the XML specifying the context.

## Outputs

This table lists the output pins for this operator.
Output pins provide the results of the operator's computation and can be connected to inputs of other operators or retrieved for further processing.
Each output is detailed in the sections that follow the table.

| Pin number | Name | Expected type(s) |
| - | - | - |
| **0** | [grpc\_streams](#output_0) | [`streams_container`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#streams-container) |

### grpc\_streams (Pin 0)

* **Expected type(s):** [`streams_container`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#streams-container)

dpf streams handling the server, if the server is started in this thread, then nothing is added in output

## Configurations

This operator supports [configuration options](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/operator-configurations.md) that modify its behavior.

### [mutex](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/operator-configurations.md#mutex)

* **Expected type(s):** [`bool`](https://developer.synopsys.com/docs/dpf/dpf-framework/2025-r2/core-concepts/dpf-types#standard-types)
* **Default value:** false

If this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads.

## Scripting

This operator can be accessed through scripting interfaces using these identifiers.

**Category**: server

**Plugin**: grpc

**Scripting name**: grpc\_start\_server

**Full name**: server.grpc\_start\_server

**Internal name**: grpc::stream\_provider

**License**: None

## Examples

These examples demonstrate how to use this operator in different programming environments.
Each example shows how to instantiate the operator, connect the required inputs, and retrieve the output.

<details>
  <summary>C++</summary>

  ```cpp theme={null}
  #include "dpf_api.h"

  ansys::dpf::Operator op("grpc::stream_provider"); // operator instantiation
  op.connect(0, my_ip);
  op.connect(1, my_port);
  op.connect(2, my_starting_option);
  op.connect(3, my_should_start_server);
  op.connect(4, my_data_sources);
  op.connect(5, my_dpf_context);
  ansys::dpf::Streams my_grpc_streams = op.getOutput<ansys::dpf::Streams>(0);
  ```
</details>

<details>
  <summary>CPython</summary>

  ```python theme={null}
  import ansys.dpf.core as dpf

  op = dpf.operators.server.grpc_start_server() # operator instantiation
  op.inputs.ip.connect(my_ip)
  op.inputs.port.connect(my_port)
  op.inputs.starting_option.connect(my_starting_option)
  op.inputs.should_start_server.connect(my_should_start_server)
  op.inputs.data_sources.connect(my_data_sources)
  op.inputs.dpf_context.connect(my_dpf_context)
  my_grpc_streams = op.outputs.grpc_streams()
  ```
</details>

<details>
  <summary>IPython</summary>

  ```python theme={null}
  import mech_dpf
  import Ans.DataProcessing as dpf

  op = dpf.operators.server.grpc_start_server() # operator instantiation
  op.inputs.ip.Connect(my_ip)
  op.inputs.port.Connect(my_port)
  op.inputs.starting_option.Connect(my_starting_option)
  op.inputs.should_start_server.Connect(my_should_start_server)
  op.inputs.data_sources.Connect(my_data_sources)
  op.inputs.dpf_context.Connect(my_dpf_context)
  my_grpc_streams = op.outputs.grpc_streams.GetData()
  ```
</details>

## Changelog

* Version 0.0.0: Initial release.
