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

# TCP Server Connector

> Host a generic TCP/IP endpoint for receiving arbitrary data streams, with configurable message delimitation, TLS/SSL support, and bidirectional communication.

export const TrustedIp = () => <>
    <p><strong>Trusted IP Addresses</strong> セクションでは、次の機能を使用できます。</p>

    <table>
      <thead>
        <tr><th>機能</th><th>説明</th></tr>
      </thead>
      <tbody>
        <tr><td><strong>Add</strong></td><td>新しいIP アドレス範囲を入力します。</td></tr>
        <tr><td><strong>Edit</strong></td><td>選択したIP アドレス範囲を変更します。</td></tr>
        <tr><td><strong>Delete</strong></td><td>選択したIP アドレス範囲をリストから削除します。</td></tr>
      </tbody>
    </table>

    <p>この機能には次の制限が適用されます。</p>

    <ul style={{
  listStyleType: 'disc',
  paddingLeft: '1.5rem'
}}>
      <li style={{
  display: 'list-item'
}}><code>localhost</code> はリストから変更または削除できません。</li>
      <li style={{
  display: 'list-item'
}}>定義された範囲外のIP アドレスはすべて拒否されます。</li>
      <li style={{
  display: 'list-item'
}}>範囲がサポートされています。例えば、エントリ<code>100.10.100.1-15</code> は、<code>100.10.100.1</code> から<code>100.10.100.15</code> までのIP アドレスが許可されることを示します。</li>
      <li style={{
  display: 'list-item'
}}>Classless inter-domain routing（CIDR）表記がサポートされています。例えば、エントリ<code>100.10.100.0/24</code> は、<code>100.10.100.0</code> から<code>100.10.100.255</code> までのIP アドレスが許可されることを示します。</li>
      <li style={{
  display: 'list-item'
}}>ワイルドカードパターンがサポートされています。例えば、エントリ<code>100.10.100.*</code> は、<code>100.10.100</code> で始まるIP アドレスが許可されることを示します。</li>
    </ul>

    <Note>
      <p>クライアントがサーバーに到達するには、明確なネットワークパスが必要です。クラウド環境では、次の3か所で変更が必要になる場合があります。</p>
      <p style={{
  paddingLeft: '1.5rem',
  marginTop: '0.25rem',
  marginBottom: '0.25rem'
}}>• クラウドコンソールのネットワークルール。</p>
      <p style={{
  paddingLeft: '1.5rem',
  marginTop: '0.25rem',
  marginBottom: '0.25rem'
}}>• アプリケーションをホストするマシンのファイアウォールルール。例えば、Amazon AMI を使用する場合、<em>Uncomplicated Firewall</em>（UFW）を使用して目的のポートでのトラフィックを許可できます。Linux 環境での一般的な方法は、1024 より小さいポートから1024 より大きい非標準ポートへトラフィックを転送し、アプリケーションがその非標準ポートを使用するように設定することです。これにより、非rootユーザーが1024 より小さいポートにバインドする際の権限の問題を回避できます。</p>
      <p style={{
  paddingLeft: '1.5rem',
  marginTop: '0.25rem',
  marginBottom: '0.25rem'
}}>• <a href="/26.3/cloud/ja/getting-started/administration/settings/security">Security</a> タブの<a href="/26.3/cloud/ja/getting-started/administration/settings/network-access">Network Access</a> 部分。</p>
    </Note>
  </>;

export const ServiceLogs = () => <p><strong>ログ</strong>タブには、このコネクタが生成したサービスログが一覧表示されます。各行はログファイルを表し、更新日時、ファイル名、サイズ、ステータスが表示されます。特定のログを検索するには検索バーまたはステータスフィルタを使用し、ファイル名をクリックしてプレビューまたはダウンロードするか、<strong>すべてのログをダウンロード</strong>をクリックしてすべてのログを単一のzipファイルとしてダウンロードします。</p>;

export const SlasTab = ({siteName = "CData Arc"}) => <>
    <p><em>サービスレベルアグリーメント（SLA）の設定に関する設定です。</em></p>
    <p>
      SLA を使用すると、フロー内のコネクタが送受信すると見込まれるボリュームを設定し、そのボリュームを達成すると見込まれる期間を設定できます。{siteName} は、SLA が達成されない場合にユーザーへ警告するメールを送信し、SLA を<em>At Risk</em> としてマークします。これは、SLA が間もなく達成されない場合に<em>Violated</em> としてマークされることを意味します。これにより、ユーザーは介入してSLA が達成されない理由を特定し、適切な対応を取る機会を得られます。At Risk 期間の終了時点でもSLA が達成されない場合、SLA はviolated としてマークされ、ユーザーに再度通知されます。
    </p>
    <p>
      SLA を定義するには、<strong>Expected Volume</strong> をオンに切り替え、<strong>Settings</strong> タブをクリックします。
    </p>
    <img src="/public/images/sla_empty.png" alt="SLA Empty" />
    <ul>
      <li>コネクタに送信と受信の個別のアクションがある場合は、ラジオボタンを使用してSLA がどちらの方向に適用されるかを指定します。</li>
      <li>ウィンドウの<strong>Expect at least</strong> 部分で、次を設定します。
        <ul>
          <li>処理を見込む最小トランザクション数（ボリューム）を設定します。</li>
          <li><strong>Every</strong> フィールドを使用して期間を指定します。</li>
          <li>SLA を有効にするタイミングを指定します。<strong>Starting on</strong> を選択した場合は、日付および時刻フィールドを入力します。</li>
          <li>SLA を有効にしたい曜日のチェックボックスをオンにします。必要に応じて、ドロップダウンで<strong>Everyday</strong> を選択します。</li>
        </ul>
      </li>
      <li>ウィンドウの<strong>Set status to 'At Risk'</strong> 部分で、SLA をAt Risk としてマークするタイミングを指定します。
        <ul>
          <li>デフォルトでは、SLA が違反状態になるまで通知は送信されません。これを変更するには、<strong>Send an 'At Risk' notification</strong> をオンにします。</li>
        </ul>
      </li>
    </ul>
    <p>
      次の例は、月曜日から金曜日まで毎日1000 件のファイルを受信すると見込むコネクタ向けに設定されたSLA を示しています。1000 件のファイルが受信されていない場合、期間の終了の1時間前にAt Risk 通知が送信されます。
    </p>
    <img src="/public/images/sla_defined.png" alt="SLA Configuration Example" />
    <Note>
      必要に応じてSLA アラートをオフにすることができます。これはメンテナンスウィンドウ中に役立ちます。navbar で<strong>Settings</strong> をクリックし、<strong>Alerts &gt; General Alerts</strong> に移動します。タブレットと鉛筆のアイコンをクリックして編集し、<strong>SLA Alerts</strong> 設定のチェックを外します。
    </Note>
  </>;

export const AlertsTab = ({siteNameShort = "Arc"}) => <>
    <p><em>アラートの設定に関する設定です。</em></p>
    <p>
      サービスレベルアグリーメント（SLA）を実行する前に、通知用のメールアラートをセットアップする必要があります。デフォルトでは、{siteNameShort} は<a href="/26.3/cloud/ja/getting-started/administration/settings/alerts">Alerts</a> タブのグローバル設定を使用します。このコネクタに別の設定を使用するには、<strong>Override global setting</strong> をオンに切り替えます。
    </p>
    <p>
      デフォルトではエラーアラートが有効になっており、エラーが発生するたびにメールが送信されます。これをオフにするには、<strong>Enable</strong> チェックボックスのチェックを外します。
    </p>
    <p>
      <strong>Subject</strong>（必須）を入力します。<strong>Allow {siteNameShort}Script in Subject</strong> をチェックすると、<strong>Subject</strong> フィールドで{siteNameShort}Script を使用できます。これを選択すると、<strong>{siteNameShort}Script エディタ</strong>ボタンが表示されます（<img src="/public/images/rest_arcscript_editor.png" alt="arcscript editor button" style={{
  display: 'inline',
  verticalAlign: 'middle',
  margin: 0
}} />）。
    </p>
    <p>
      必要に応じて<strong>Recipient</strong> のメールアドレスをカンマ区切りのリストで入力します。
    </p>
  </>;

export const MiscConnector = () => <>
    <p><em>Miscellaneous 設定は、特定のユースケース向けの設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Other Settings</strong></td>
          <td>非表示のコネクタ設定をセミコロン区切りのリストで設定できます（例：<code>setting1=value1;setting2=value2</code>）。通常のコネクタのユースケースや機能では、これらの設定の使用は必要ありません。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const Logging = () => <>
    <p><em>ログの作成と保存を制御する設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Log Level</strong></td>
          <td>コネクタが生成するログの詳細度です。サポートを依頼する際は、これを<strong>Debug</strong> に設定してください。</td>
        </tr>
        <tr>
          <td><strong>Log Subfolder Scheme</strong></td>
          <td>選択した間隔に従って、コネクタがLogs フォルダ内のファイルをグループ化するよう指示します。<strong>Weekly</strong> オプション（デフォルト）は、コネクタが毎週新しいサブフォルダを作成し、その週のすべてのログをそのフォルダに保存するよう指示します。この設定を空白のままにすると、コネクタはすべてのログをLogs フォルダに直接保存します。多数のトランザクションを処理するコネクタでは、サブフォルダを使用することでログを整理しやすくなり、パフォーマンスが向上します。</td>
        </tr>
        <tr>
          <td><strong>Log Messages</strong></td>
          <td>処理したファイルのログエントリにファイル自体のコピーを含めるには、これをオンにします。これを無効にすると、<strong>Transactions</strong> タブからファイルのコピーをダウンロードできなくなる場合があります。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const MacrosExamples = ({extraMacros = []}) => <>
    <p>
      %Ext% や %ShortDate% などの一部のマクロは引数を必要としませんが、引数を必要とするものもあります。
      引数を取るすべてのマクロは次の構文を使用します。<code>%Macro:argument%</code>
    </p>

    <p>引数を取るマクロの例を次に示します。</p>

    <ul>
      <li>%Header:headername%：<code>headername</code> はメッセージ上のヘッダーの名前です。</li>
      <li>%Header:mycustomheader% は、入力メッセージに設定された<code>mycustomheader</code> ヘッダーの値に解決されます。</li>
      <li>%Header:ponum% は、入力メッセージに設定された<code>ponum</code> ヘッダーの値に解決されます。</li>
      <li>%RegexFilename:pattern%：<code>pattern</code> は正規表現パターンです。例えば、<code>%RegexFilename:^([\w][A-Za-z]+)%</code> は、ファイル名の最初の単語にマッチしてそれに解決され、大文字・小文字を区別しません（<code>test_file.xml</code> は<code>test</code> に解決されます）。</li>
      <li>%Vault:vaultitem%：<code>vaultitem</code> は<a href="/26.3/cloud/ja/getting-started/administration/settings/global-settings-vault">Vault</a> 内のアイテムの名前です。例えば、<code>%Vault:companyname%</code> は、Vault に保存された<code>companyname</code> アイテムの値に解決されます。</li>
      <li>%DateFormat:format%：<code>format</code> は許容される日付形式です（詳細は<a href="/26.3/cloud/ja/scripting/value-formatters/date-formatters#sample-date-formats">日付形式のサンプル</a>を参照してください）。例えば、<code>%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%</code> は、ファイルの日付とタイムスタンプに解決されます。</li>
      {extraMacros.filter(item => item.example).map(item => <li key={`ex-${item.name}`}>{item.example}</li>)}
    </ul>

    <p>次の例に示すように、より高度なマクロを作成することもできます。</p>

    <ul>
      <li>1 つのファイル名で複数のマクロを組み合わせる：<code>%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%%EXT%</code></li>
      <li>マクロの外側にテキストを含める：<code>MyFile_%DateFormat:yyyy-MM-dd-HH-mm-ss-fff%</code></li>
      <li>マクロの内側にテキストを含める：<code>%DateFormat:'DateProcessed-'yyyy-MM-dd_'TimeProcessed-'HH-mm-ss%</code></li>
    </ul>
  </>;

export const MacrosTable = ({siteName = "CData Arc", extraMacros = []}) => <>
    <p>
      ファイル命名戦略でマクロを使用すると、データの整理効率と文脈の理解を高めることができます。
      ファイル名にマクロを組み込むことで、識別子、タイムスタンプ、ヘッダー情報などの関連情報を
      動的に含めることができ、各ファイルに有用な文脈を提供します。
    </p>

    <p>{siteName} は次のマクロをサポートしています。これらはすべて次の構文を使用します。<code>%Macro%</code></p>

    <table>
      <thead>
        <tr><th>マクロ</th><th>説明</th></tr>
      </thead>
      <tbody>
        <tr><td>ConnectorID</td><td>コネクタのConnectorID に評価されます。</td></tr>
        <tr><td>ConnectorName</td><td>コネクタの名前に評価されます。ファイル名やパスに接続名を含めることができます。例えば、どのデータベース接続が生成したかによってバックアップファイルにタグを付けるために使用できます。</td></tr>
        <tr><td>Ext</td><td>コネクタが現在処理しているファイルの拡張子に評価されます。</td></tr>
        <tr><td>Filename</td><td>コネクタが現在処理しているファイルのファイル名（拡張子を含む）に評価されます。</td></tr>
        <tr><td>FilenameNoExt</td><td>コネクタが現在処理しているファイルのファイル名（拡張子を除く）に評価されます。</td></tr>
        <tr><td>MessageId</td><td>コネクタが出力しているメッセージのMessageId に評価されます。</td></tr>
        <tr><td>RegexFilename:<em>pattern</em></td><td>コネクタが現在処理しているファイルのファイル名に正規表現パターンを適用します。</td></tr>
        <tr><td>Header:<em>headername</em></td><td>コネクタが現在処理しているメッセージ上の対象ヘッダー（<code>headername</code>）の値に評価されます。</td></tr>
        <tr><td>LongDate</td><td>システムの現在の日時を長い形式（例：Wednesday, January 24, 2024）で評価します。</td></tr>
        <tr><td>ShortDate</td><td>システムの現在の日時をyyyy-MM-dd 形式（例：2024-01-24）で評価します。</td></tr>
        <tr><td>DateFormat:<em>format</em></td><td>システムの現在の日時を指定された形式（<code>format</code>）で評価します。利用可能な日時形式については、<a href="/26.3/cloud/ja/scripting/value-formatters/date-formatters#date-formats-with-literal-characters">日付形式のサンプル</a>を参照してください。</td></tr>
        <tr><td>Vault:<em>vaultitem</em></td><td>指定されたVault アイテムの値に評価されます。</td></tr>
        {extraMacros.map(item => <tr key={item.name}>
            <td>{item.name}</td>
            <td>{item.description}</td>
          </tr>)}
      </tbody>
    </table>
  </>;

export const Performance = () => <>
    <p><em>コネクタへのリソースの割り当てに関する設定です。</em></p>
    <table>
      <thead>
        <tr>
          <th>設定</th>
          <th>説明</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Max Workers</strong></td>
          <td>このコネクタでファイルを処理するためにスレッドプールから消費されるワーカースレッドの最大数です。設定すると、<a href="/26.3/cloud/ja/getting-started/administration/settings/advanced-settings">Advanced Settings</a> ページの<a href="/26.3/cloud/ja/getting-started/administration/settings/performance-settings">Performance Settings</a> 部分にあるデフォルト設定が上書きされます。</td>
        </tr>
        <tr>
          <td><strong>Max Files</strong></td>
          <td>コネクタに割り当てられた各スレッドが送信するファイルの最大数です。設定すると、<a href="/26.3/cloud/ja/getting-started/administration/settings/advanced-settings">Advanced Settings</a> ページの<a href="/26.3/cloud/ja/getting-started/administration/settings/performance-settings">Performance Settings</a> 部分にあるデフォルト設定が上書きされます。</td>
        </tr>
      </tbody>
    </table>
  </>;

export const siteNameShort = "Arc";

export const siteName = "CData Arc";

export const extraMacros = [{
  name: "ConnectionId",
  description: "Evaluates to the ConnectionId of the connection a client used to upload data."
}, {
  name: "RemoteHost",
  description: "Evaluates to the ConnectionId of the connection that the client used to upload data."
}];

TCP Server connectors support hosting a generic endpoint for receiving data over TCP.

## Key Capabilities

* Generic TCP/IP server endpoint with TLS/SSL and plain text support for arbitrary data streams
* Configurable message delimitation using static delimiters or length-based parsing
* Bidirectional communication with Connection ID-based routing and connection event messaging

## Overview

Each TCP Server connector listens on a specified port for incoming TCP traffic, either with TLS/SSL encryption or plain text. Use this connector when {siteName} needs to receive arbitrary data that does not necessarily fit into the constraints provided by other standard protocols.

Since TCP traffic is a constant stream that does not intrinsically have a start or end point, you must configure the connector to determine where one message ends and the next begins. The connector supports two approaches:

* A static string/character delimiter that ends the current message or begins the next message
* Reading a value in the incoming TCP data to determine how long the message should be

For the second approach, the connector requires an offset (how many bytes after the first byte to begin reading the message length) and a size (how many bytes to read, starting at the offset, to get the length value). If the length of the message is the first value in the header for the message, the offset is 0.

Once the delimiter or length is reached, the connector pushes a message into the {siteNameShort} flow containing the raw data received over TCP.

The TCP Server connector can also generate an {siteNameShort} message when a client connects or disconnects, to alert other processes within the flow. See the [Connected and Disconnected Messages](#connected-and-disconnected-messages) section for more information.

For information on sending responses back to TCP clients, see the [Sending Messages](#sending-messages) section.

## Connector Settings

### Settings Tab

#### Configuration

*Settings related to the core configuration of the connector.*

| Setting                   | Description                                                                                                                                                   |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connector Id**          | The static, unique identifier for the connector.                                                                                                              |
| **Connector Type**        | Displays the connector name and a description of what it does.                                                                                                |
| **Connector Description** | An optional field to provide a free-form description of the connector and its role in the flow.                                                               |
| **Port**                  | The port on which to listen for incoming TCP connections.                                                                                                     |
| **サーバーステータス**             | コネクタのサーバーの状態：**アクティブ**（サーバーが実行中。**サーバーを停止**をクリックして停止します）、**非アクティブ**（サーバーが実行されていません。**サーバーを起動**をクリックして起動します）。サーバーの実行中に生成されたログを確認するには、[ログタブ](#logs-tab)をご覧ください。 |

#### Message Decoding

*Settings related to distinguishing individual messages from the TCP stream.*

| Setting                     | Description                                                                                             |
| --------------------------- | ------------------------------------------------------------------------------------------------------- |
| **Message Start Delimiter** | The single character or hexadecimal value (prefixed by `0x`) indicating the start of a new message.     |
| **Message End Delimiter**   | The single character or hexadecimal value (prefixed by `0x`) indicating the end of the current message. |
| **Message Length Offset**   | The number of bytes to skip before beginning to read the length of the message from the incoming data.  |
| **Message Length Size**     | The size in bytes of the length value in the incoming data.                                             |

#### TLS Settings

*Settings related to TLS/SSL transport security.*

| Setting                  | Description                                                                     |
| ------------------------ | ------------------------------------------------------------------------------- |
| **Enable TLS**           | Whether clients must negotiate TLS/SSL encryption to connect to the TCP server. |
| **Server Certificate**   | The TLS/SSL certificate that identifies the TCP server.                         |
| **Certificate Password** | The password to access the server certificate's private key.                    |

### Advanced Tab

#### Keep Alive

*Settings related to keep-alive packets sent by the server to maintain an idle connection.*

| Setting                 | Description                                                                                                       |
| ----------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **Keep Alive**          | Whether to send keep-alive packets periodically to ensure that idle connections are not closed due to inactivity. |
| **Keep Alive Time**     | The length of inactivity that should elapse before sending the first keep-alive packet.                           |
| **Keep Alive Interval** | The interval between consecutive keep-alive packets.                                                              |

#### Advanced Settings

*Settings not included in the previous categories.*

| Setting                   | Description                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Connected Messages**    | Whether the connector should generate an {siteNameShort} message when a client connects. See the [Connected and Disconnected Messages](#connected-and-disconnected-messages) section for more information.                                                                                                                                                                   |
| **Disconnected Messages** | Whether the connector should generate an {siteNameShort} message when a client disconnects. See the [Connected and Disconnected Messages](#connected-and-disconnected-messages) section for more information.                                                                                                                                                                |
| **Idle Timeout**          | The length of time (in seconds) the server should wait for an idle client before disconnecting them due to inactivity.                                                                                                                                                                                                                                                       |
| **Local File Scheme**     | A scheme for assigning filenames to messages that are output by the connector. You can use macros in your filenames dynamically to include information such as identifiers and timestamps. For more information, see [Macros](#macros).                                                                                                                                      |
| **Local Host**            | The binding address of the local server, if not the default network interface.                                                                                                                                                                                                                                                                                               |
| **Max Connections**       | The maximum number of concurrent connectors.                                                                                                                                                                                                                                                                                                                                 |
| **TLS Enabled Protocols** | The list of TLS/SSL protocols supported when establishing outgoing connections. Best practice is to only use TLS protocols. SSL v2 and SSL v3 are considered vulnerable and should only be used if your partner does not support higher versions. Keep in mind that TLS v1.3 is not universally adopted, and might be refused if the destination server does not support it. |

#### Logging

<Logging />

#### Miscellaneous

<MiscConnector />

### Server Tab

#### Trusted IP Addresses

<TrustedIp />

### Automation Tab

#### Automation

*Settings related to the automatic processing of files by the connector.*

| Setting  | Description                                                             |
| -------- | ----------------------------------------------------------------------- |
| **Send** | Whether messages arriving at the connector are automatically processed. |

#### Performance

<Performance />

### Alerts Tab

<AlertsTab />

### SLAs Tab

<SlasTab />

### ログタブ

<ServiceLogs />

## Connected and Disconnected Messages

By default, the TCP Server connector only generates {siteNameShort} messages when clients transfer data that the connector recognizes as a full message (according to the settings in the [Message Decoding](#message-decoding) section). The connector can also generate {siteNameShort} messages when a client connects to the server (if **Connected Messages** is enabled on the [Advanced tab](#advanced-tab)) or disconnects from the server (if **Disconnected Messages** is enabled on the Advanced tab).

When these special messages are generated, a special header is added to the {siteNameShort} message:

`x-tcpserver-event`

This header is set to the value `connected` when clients are connecting, and `disconnected` when clients are disconnecting.

This header value must be checked by later connectors in the flow to detect whether a message written to the output folder of a TCP Server connector is one of these special messages.

## Sending Messages

The TCP Server connector also uses a special header value to send messages back to connected clients:

`x-tcpserver-connectionid`

This header is added to any output messages generated by the connector, and is set to a Connection ID value that uniquely identifies the connected client. Messages that should be sent back to this client *must* have this header set to the same value to ensure that the message is sent to the appropriate client.

Since this header is already present on any messages written out by the connector, if the message passes through an {siteNameShort} flow and arrives back at the **Transactions** for the TCP Server connector, it still has the same Connection ID value and is returned to the client that sent the original message. If the message cannot be directly routed back to the TCP Server connector, the Connection ID value must be saved and applied as a header (with the name shown above) to any new messages that should be returned to the client.

## Macros

<MacrosTable extraMacros={extraMacros} />

### Examples

<MacrosExamples extraMacros={extraMacros} />
