1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-10-30 23:47:46 +02:00

Фикс доков

This commit is contained in:
Anton Titovets
2024-12-25 09:49:01 +03:00
parent 2ed1b74f3d
commit d4df4049f0
4 changed files with 35 additions and 4 deletions

View File

@@ -7,4 +7,19 @@ sidebar_class_name: TCP
# TCP (Client)
This section is dedicated to the library for working with the TCP. On this page, all the steps necessary to start working are described
This section is dedicated to the library for working with the TCP. On this page, all the steps necessary to start working are described
## About implemented methods
This library provides several ready-made methods for working as a TCP client. The standard scheme of interaction with the server is as follows:
1. The object is created and connected to the server using the `CreateConnection` function. The connection string in the format `<address>:<port>` is passed there.
2. If necessary, a message can be sent to the server using the `SendBinaryData` and `SendLine` functions
3. To receive data from the server, the `ReadBinaryData` and `ReadLine` functions are used. They have different parameters to limit the received data by size, token and waiting for input (timeout)
4. At the end of work it is desirable to explicitly terminate the connection using the `CloseConnection` function
For a simple scenario with standard settings, there is also the `ProcessRequest` function - it sends data to the specified address and waits for a response, finishing reading when the standard `\\n` token is found. It is also the only function that is available in the CLI version of the OPI
## Compatibility
Technically, the client implementation is a Native component in Rust. It comes in a zip archive format, and, in theory, should work on all available platforms: x86 and x64 Windows and Linux. The actual testing was done on Windows x64 and, cossentially (via OneScript), on Linux x64

View File

@@ -7,4 +7,19 @@ sidebar_class_name: TCP
# TCP (Клиент)
Этот раздел посвящен библиотеке для работы с протоколом TCP. На данной странице описаны все действия, необходимые для полноценного начала работы
Этот раздел посвящен библиотеке для работы с протоколом TCP. На данной странице описаны все действия, необходимые для полноценного начала работы
## О реализованных методах
Данная библиотека предоставляет несколько готовых методов для работы в качестве TCP клиента. Стандартная схема взаимодействия с сервером выглядит следующим образом:
1. Создание объекта и подключение к серверу производится при помощи функции `ОткрытьСоединение`. Туда передается строка подключения в формате `<адрес>:<порт>`
2. При необходимости, серверу можно отправить сообщение при помощи функций `ОтправитьДвоичныеДанные` и `ОтправитСтроку`
3. Для получения данных от сервера, используются функции `ПрочитатьДвоичныеДанные` и `ПрочитатьСтроку`. Они имеют различные параметры для ограничения получаемых данных по размеру, маркеру и ожиданию ввода (таймауту)
4. При окончании работы желательно явно завершать соединение при помощи функции `ЗакрытьСоединение`
Для простого сценария со стандартными настройками, также существует функция `ОбработатьЗапрос` - она отправляет данные на указанный адрес и ждет ответа, завершая чтение при нахождении стандартного маркера `\\n`. Также это единственная функция, которая доступна в CLI версии ОПИ
## Совместимость
Технически, реализация клиента представляет из себя Native компоненту на Rust. Она поставляется в формате zip-архива, и, теоретически, должна работать на всех доступных платформах: x86 и x64 Windows и Linux. Фактическое тестирование проводилось на Windows x64 и, коссвенно (через OneScript), на Linux x64