mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-03-21 21:27:27 +02:00
Main build (Jenkins)
This commit is contained in:
parent
1b11e0d00a
commit
737b33ba83
docs
en
data/TCP
examples/TCP
md/TCP/Tcp-client
ru
service/dictionaries
src
en
ru
OInt
OPI/src/CommonModules/OPI_Тесты
3
docs/en/data/TCP/ReadLine.json
Normal file
3
docs/en/data/TCP/ReadLine.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"Address": "45.79.112.203:4242"
|
||||||
|
}
|
3
docs/en/data/TCP/SendLine.json
Normal file
3
docs/en/data/TCP/SendLine.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"Address": "45.79.112.203:4242"
|
||||||
|
}
|
12
docs/en/examples/TCP/ReadLine.txt
Normal file
12
docs/en/examples/TCP/ReadLine.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
Address = "45.79.112.203:4242";
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
Data = "Hello server!" + Chars.LF;
|
||||||
|
|
||||||
|
OPI_TCP.SendLine(Connection, Data);
|
||||||
|
|
||||||
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
|
Marker = Chars.LF;
|
||||||
|
Result = OPI_TCP.ReadLine(Connection, , Marker);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
@ -3,11 +3,11 @@
|
|||||||
Message = "Hello server!" + Chars.LF;
|
Message = "Hello server!" + Chars.LF;
|
||||||
Data = ПолучитьДвоичныеДанныеИзСтроки(Message);
|
Data = ПолучитьДвоичныеДанныеИзСтроки(Message);
|
||||||
|
|
||||||
OPI_TCP.SendBinaryData(Connection, Data);
|
Result = OPI_TCP.SendBinaryData(Connection, Data);
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
// End of message marker to avoid waiting for the end of timeout
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
Marker = Chars.LF;
|
Marker = Chars.LF;
|
||||||
Result = OPI_TCP.ReadBinaryData(Connection, , Marker);
|
Response = OPI_TCP.ReadBinaryData(Connection, , Marker);
|
||||||
|
|
||||||
OPI_TCP.CloseConnection(Connection);
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
12
docs/en/examples/TCP/SendLine.txt
Normal file
12
docs/en/examples/TCP/SendLine.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
Address = "45.79.112.203:4242";
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
Data = "Hello server!" + Chars.LF;
|
||||||
|
|
||||||
|
Result = OPI_TCP.SendLine(Connection, Data);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
|
Marker = Chars.LF;
|
||||||
|
Response = OPI_TCP.ReadLine(Connection, , Marker);
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
@ -38,7 +38,18 @@ Parameters with Binary data type can also accept file paths on disk and URLs
|
|||||||
|
|
||||||
|
|
||||||
```bsl title="1C:Enterprise/OneScript code example"
|
```bsl title="1C:Enterprise/OneScript code example"
|
||||||
|
Address = "45.79.112.203:4242";
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
Data = "Hello server!" + Chars.LF;
|
||||||
|
|
||||||
|
OPI_TCP.SendLine(Connection, Data);
|
||||||
|
|
||||||
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
|
Marker = Chars.LF;
|
||||||
|
Result = OPI_TCP.ReadLine(Connection, , Marker);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,12 +40,12 @@ Parameters with Binary data type can also accept file paths on disk and URLs
|
|||||||
Message = "Hello server!" + Chars.LF;
|
Message = "Hello server!" + Chars.LF;
|
||||||
Data = ПолучитьДвоичныеДанныеИзСтроки(Message);
|
Data = ПолучитьДвоичныеДанныеИзСтроки(Message);
|
||||||
|
|
||||||
OPI_TCP.SendBinaryData(Connection, Data);
|
Result = OPI_TCP.SendBinaryData(Connection, Data);
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
// End of message marker to avoid waiting for the end of timeout
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
Marker = Chars.LF;
|
Marker = Chars.LF;
|
||||||
Result = OPI_TCP.ReadBinaryData(Connection, , Marker);
|
Response = OPI_TCP.ReadBinaryData(Connection, , Marker);
|
||||||
|
|
||||||
OPI_TCP.CloseConnection(Connection);
|
OPI_TCP.CloseConnection(Connection);
|
||||||
```
|
```
|
||||||
|
@ -33,7 +33,18 @@ import TabItem from '@theme/TabItem';
|
|||||||
|
|
||||||
|
|
||||||
```bsl title="1C:Enterprise/OneScript code example"
|
```bsl title="1C:Enterprise/OneScript code example"
|
||||||
|
Address = "45.79.112.203:4242";
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
Data = "Hello server!" + Chars.LF;
|
||||||
|
|
||||||
|
Result = OPI_TCP.SendLine(Connection, Data);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
|
Marker = Chars.LF;
|
||||||
|
Response = OPI_TCP.ReadLine(Connection, , Marker);
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
3
docs/ru/data/TCP/ОтправитьСтроку.json
Normal file
3
docs/ru/data/TCP/ОтправитьСтроку.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"Адрес": "45.79.112.203:4242"
|
||||||
|
}
|
3
docs/ru/data/TCP/ПрочитатьСтроку.json
Normal file
3
docs/ru/data/TCP/ПрочитатьСтроку.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"Адрес": "45.79.112.203:4242"
|
||||||
|
}
|
@ -3,11 +3,11 @@
|
|||||||
Сообщение = "Hello server!" + Символы.ПС;
|
Сообщение = "Hello server!" + Символы.ПС;
|
||||||
Данные = ПолучитьДвоичныеДанныеИзСтроки(Сообщение);
|
Данные = ПолучитьДвоичныеДанныеИзСтроки(Сообщение);
|
||||||
|
|
||||||
OPI_TCP.ОтправитьДвоичныеДанные(Соединение, Данные);
|
Результат = OPI_TCP.ОтправитьДвоичныеДанные(Соединение, Данные);
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
// Маркер конца сообщения для исключения ожидания конца таймаута
|
// Маркер конца сообщения для исключения ожидания конца таймаута
|
||||||
Маркер = Символы.ПС;
|
Маркер = Символы.ПС;
|
||||||
Результат = OPI_TCP.ПрочитатьДвоичныеДанные(Соединение, , Маркер);
|
Ответ = OPI_TCP.ПрочитатьДвоичныеДанные(Соединение, , Маркер);
|
||||||
|
|
||||||
OPI_TCP.ЗакрытьСоединение(Соединение);
|
OPI_TCP.ЗакрытьСоединение(Соединение);
|
||||||
|
12
docs/ru/examples/TCP/ОтправитьСтроку.txt
Normal file
12
docs/ru/examples/TCP/ОтправитьСтроку.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
Адрес = "45.79.112.203:4242";
|
||||||
|
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
||||||
|
Данные = "Hello server!" + Символы.ПС;
|
||||||
|
|
||||||
|
Результат = OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
// Маркер конца сообщения для исключения ожидания конца таймаута
|
||||||
|
Маркер = Символы.ПС;
|
||||||
|
Ответ = OPI_TCP.ПрочитатьСтроку(Соединение, , Маркер);
|
||||||
|
|
||||||
|
OPI_TCP.ЗакрытьСоединение(Соединение);
|
12
docs/ru/examples/TCP/ПрочитатьСтроку.txt
Normal file
12
docs/ru/examples/TCP/ПрочитатьСтроку.txt
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
Адрес = "45.79.112.203:4242";
|
||||||
|
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
||||||
|
Данные = "Hello server!" + Символы.ПС;
|
||||||
|
|
||||||
|
OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
||||||
|
|
||||||
|
// Маркер конца сообщения для исключения ожидания конца таймаута
|
||||||
|
Маркер = Символы.ПС;
|
||||||
|
Результат = OPI_TCP.ПрочитатьСтроку(Соединение, , Маркер);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
OPI_TCP.ЗакрытьСоединение(Соединение);
|
@ -38,7 +38,18 @@ import TabItem from '@theme/TabItem';
|
|||||||
|
|
||||||
|
|
||||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||||
|
Адрес = "45.79.112.203:4242";
|
||||||
|
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
||||||
|
Данные = "Hello server!" + Символы.ПС;
|
||||||
|
|
||||||
|
OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
||||||
|
|
||||||
|
// Маркер конца сообщения для исключения ожидания конца таймаута
|
||||||
|
Маркер = Символы.ПС;
|
||||||
|
Результат = OPI_TCP.ПрочитатьСтроку(Соединение, , Маркер);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
OPI_TCP.ЗакрытьСоединение(Соединение);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,12 +40,12 @@ import TabItem from '@theme/TabItem';
|
|||||||
Сообщение = "Hello server!" + Символы.ПС;
|
Сообщение = "Hello server!" + Символы.ПС;
|
||||||
Данные = ПолучитьДвоичныеДанныеИзСтроки(Сообщение);
|
Данные = ПолучитьДвоичныеДанныеИзСтроки(Сообщение);
|
||||||
|
|
||||||
OPI_TCP.ОтправитьДвоичныеДанные(Соединение, Данные);
|
Результат = OPI_TCP.ОтправитьДвоичныеДанные(Соединение, Данные);
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
// Маркер конца сообщения для исключения ожидания конца таймаута
|
// Маркер конца сообщения для исключения ожидания конца таймаута
|
||||||
Маркер = Символы.ПС;
|
Маркер = Символы.ПС;
|
||||||
Результат = OPI_TCP.ПрочитатьДвоичныеДанные(Соединение, , Маркер);
|
Ответ = OPI_TCP.ПрочитатьДвоичныеДанные(Соединение, , Маркер);
|
||||||
|
|
||||||
OPI_TCP.ЗакрытьСоединение(Соединение);
|
OPI_TCP.ЗакрытьСоединение(Соединение);
|
||||||
```
|
```
|
||||||
|
@ -33,7 +33,18 @@ import TabItem from '@theme/TabItem';
|
|||||||
|
|
||||||
|
|
||||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||||
|
Адрес = "45.79.112.203:4242";
|
||||||
|
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
||||||
|
Данные = "Hello server!" + Символы.ПС;
|
||||||
|
|
||||||
|
Результат = OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
// Маркер конца сообщения для исключения ожидания конца таймаута
|
||||||
|
Маркер = Символы.ПС;
|
||||||
|
Ответ = OPI_TCP.ПрочитатьСтроку(Соединение, , Маркер);
|
||||||
|
|
||||||
|
OPI_TCP.ЗакрытьСоединение(Соединение);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2183,6 +2183,8 @@ Procedure TC_Client() Export
|
|||||||
TCP_CloseConnection(TestParameters);
|
TCP_CloseConnection(TestParameters);
|
||||||
TCP_ReadBinaryData(TestParameters);
|
TCP_ReadBinaryData(TestParameters);
|
||||||
TCP_SendBinaryData(TestParameters);
|
TCP_SendBinaryData(TestParameters);
|
||||||
|
TCP_ReadLine(TestParameters);
|
||||||
|
TCP_SendLine(TestParameters);
|
||||||
TCP_ProcessRequest(TestParameters);
|
TCP_ProcessRequest(TestParameters);
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
@ -15732,7 +15734,6 @@ Procedure TCP_ReadBinaryData(FunctionParameters) Export
|
|||||||
OPI_TestDataRetrieval.WriteLog(Result, "ReadBinaryData (timeout)", "TCP");
|
OPI_TestDataRetrieval.WriteLog(Result, "ReadBinaryData (timeout)", "TCP");
|
||||||
OPI_TestDataRetrieval.Check_String(Result, Message);
|
OPI_TestDataRetrieval.Check_String(Result, Message);
|
||||||
|
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure TCP_SendBinaryData(FunctionParameters) Export
|
Procedure TCP_SendBinaryData(FunctionParameters) Export
|
||||||
@ -15742,20 +15743,20 @@ Procedure TCP_SendBinaryData(FunctionParameters) Export
|
|||||||
Message = "Hello server!" + Chars.LF;
|
Message = "Hello server!" + Chars.LF;
|
||||||
Data = ПолучитьДвоичныеДанныеИзСтроки(Message);
|
Data = ПолучитьДвоичныеДанныеИзСтроки(Message);
|
||||||
|
|
||||||
OPI_TCP.SendBinaryData(Connection, Data);
|
Result = OPI_TCP.SendBinaryData(Connection, Data);
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
// End of message marker to avoid waiting for the end of timeout
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
Marker = Chars.LF;
|
Marker = Chars.LF;
|
||||||
Result = OPI_TCP.ReadBinaryData(Connection, , Marker);
|
Response = OPI_TCP.ReadBinaryData(Connection, , Marker);
|
||||||
|
|
||||||
OPI_TCP.CloseConnection(Connection);
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
// END
|
// END
|
||||||
|
|
||||||
Result = ПолучитьСтрокуИзДвоичныхДанных(Result);
|
Response = ПолучитьСтрокуИзДвоичныхДанных(Response);
|
||||||
OPI_TestDataRetrieval.WriteLog(Result, "SendBinaryData", "TCP");
|
OPI_TestDataRetrieval.WriteLog(Result, "SendBinaryData", "TCP");
|
||||||
OPI_TestDataRetrieval.Check_String(Result, Message);
|
OPI_TestDataRetrieval.Check_String(Response, Message);
|
||||||
|
|
||||||
Connection = OPI_TCP.CreateConnection(Address);
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
|
||||||
@ -15785,6 +15786,70 @@ Procedure TCP_ProcessRequest(FunctionParameters) Export
|
|||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure TCP_ReadLine(FunctionParameters) Export
|
||||||
|
|
||||||
|
Address = FunctionParameters["TCP_Address"];
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
Data = "Hello server!" + Chars.LF;
|
||||||
|
|
||||||
|
OPI_TCP.SendLine(Connection, Data);
|
||||||
|
|
||||||
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
|
Marker = Chars.LF;
|
||||||
|
Result = OPI_TCP.ReadLine(Connection, , Marker);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
|
// END
|
||||||
|
|
||||||
|
OPI_TestDataRetrieval.WriteLog(Result, "ReadLine", "TCP");
|
||||||
|
OPI_TestDataRetrieval.Check_String(Result, Data);
|
||||||
|
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
|
||||||
|
OPI_TCP.SendLine(Connection, Data);
|
||||||
|
Result = OPI_TCP.ReadLine(Connection, , , 50000);
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
|
OPI_TestDataRetrieval.WriteLog(Result, "ReadLine (timeout)", "TCP");
|
||||||
|
OPI_TestDataRetrieval.Check_String(Result, Data);
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure TCP_SendLine(FunctionParameters) Export
|
||||||
|
|
||||||
|
Address = FunctionParameters["TCP_Address"];
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
Data = "Hello server!" + Chars.LF;
|
||||||
|
|
||||||
|
Result = OPI_TCP.SendLine(Connection, Data);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
|
Marker = Chars.LF;
|
||||||
|
Response = OPI_TCP.ReadLine(Connection, , Marker);
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
|
// END
|
||||||
|
|
||||||
|
OPI_TestDataRetrieval.WriteLog(Result, "SendLine", "TCP");
|
||||||
|
OPI_TestDataRetrieval.Check_String(Response, Data);
|
||||||
|
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
|
||||||
|
OPI_TCP.SendLine(Connection, Data);
|
||||||
|
Result = OPI_TCP.ReadLine(Connection, , , 50000);
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
|
OPI_TestDataRetrieval.WriteLog(Result, "SendLine (timeout)", "TCP");
|
||||||
|
OPI_TestDataRetrieval.Check_String(Result, Data);
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
@ -2183,6 +2183,8 @@ Procedure TC_Client() Export
|
|||||||
TCP_CloseConnection(TestParameters);
|
TCP_CloseConnection(TestParameters);
|
||||||
TCP_ReadBinaryData(TestParameters);
|
TCP_ReadBinaryData(TestParameters);
|
||||||
TCP_SendBinaryData(TestParameters);
|
TCP_SendBinaryData(TestParameters);
|
||||||
|
TCP_ReadLine(TestParameters);
|
||||||
|
TCP_SendLine(TestParameters);
|
||||||
TCP_ProcessRequest(TestParameters);
|
TCP_ProcessRequest(TestParameters);
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
@ -15732,7 +15734,6 @@ Procedure TCP_ReadBinaryData(FunctionParameters) Export
|
|||||||
OPI_TestDataRetrieval.WriteLog(Result, "ReadBinaryData (timeout)", "TCP");
|
OPI_TestDataRetrieval.WriteLog(Result, "ReadBinaryData (timeout)", "TCP");
|
||||||
OPI_TestDataRetrieval.Check_String(Result, Message);
|
OPI_TestDataRetrieval.Check_String(Result, Message);
|
||||||
|
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure TCP_SendBinaryData(FunctionParameters) Export
|
Procedure TCP_SendBinaryData(FunctionParameters) Export
|
||||||
@ -15742,20 +15743,20 @@ Procedure TCP_SendBinaryData(FunctionParameters) Export
|
|||||||
Message = "Hello server!" + Chars.LF;
|
Message = "Hello server!" + Chars.LF;
|
||||||
Data = GetBinaryDataFromString(Message);
|
Data = GetBinaryDataFromString(Message);
|
||||||
|
|
||||||
OPI_TCP.SendBinaryData(Connection, Data);
|
Result = OPI_TCP.SendBinaryData(Connection, Data);
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
// End of message marker to avoid waiting for the end of timeout
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
Marker = Chars.LF;
|
Marker = Chars.LF;
|
||||||
Result = OPI_TCP.ReadBinaryData(Connection, , Marker);
|
Response = OPI_TCP.ReadBinaryData(Connection, , Marker);
|
||||||
|
|
||||||
OPI_TCP.CloseConnection(Connection);
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
// END
|
// END
|
||||||
|
|
||||||
Result = GetStringFromBinaryData(Result);
|
Response = GetStringFromBinaryData(Response);
|
||||||
OPI_TestDataRetrieval.WriteLog(Result, "SendBinaryData", "TCP");
|
OPI_TestDataRetrieval.WriteLog(Result, "SendBinaryData", "TCP");
|
||||||
OPI_TestDataRetrieval.Check_String(Result, Message);
|
OPI_TestDataRetrieval.Check_String(Response, Message);
|
||||||
|
|
||||||
Connection = OPI_TCP.CreateConnection(Address);
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
|
||||||
@ -15785,6 +15786,70 @@ Procedure TCP_ProcessRequest(FunctionParameters) Export
|
|||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure TCP_ReadLine(FunctionParameters) Export
|
||||||
|
|
||||||
|
Address = FunctionParameters["TCP_Address"];
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
Data = "Hello server!" + Chars.LF;
|
||||||
|
|
||||||
|
OPI_TCP.SendLine(Connection, Data);
|
||||||
|
|
||||||
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
|
Marker = Chars.LF;
|
||||||
|
Result = OPI_TCP.ReadLine(Connection, , Marker);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
|
// END
|
||||||
|
|
||||||
|
OPI_TestDataRetrieval.WriteLog(Result, "ReadLine", "TCP");
|
||||||
|
OPI_TestDataRetrieval.Check_String(Result, Data);
|
||||||
|
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
|
||||||
|
OPI_TCP.SendLine(Connection, Data);
|
||||||
|
Result = OPI_TCP.ReadLine(Connection, , , 50000);
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
|
OPI_TestDataRetrieval.WriteLog(Result, "ReadLine (timeout)", "TCP");
|
||||||
|
OPI_TestDataRetrieval.Check_String(Result, Data);
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
|
Procedure TCP_SendLine(FunctionParameters) Export
|
||||||
|
|
||||||
|
Address = FunctionParameters["TCP_Address"];
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
Data = "Hello server!" + Chars.LF;
|
||||||
|
|
||||||
|
Result = OPI_TCP.SendLine(Connection, Data);
|
||||||
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
// End of message marker to avoid waiting for the end of timeout
|
||||||
|
Marker = Chars.LF;
|
||||||
|
Response = OPI_TCP.ReadLine(Connection, , Marker);
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
|
// END
|
||||||
|
|
||||||
|
OPI_TestDataRetrieval.WriteLog(Result, "SendLine", "TCP");
|
||||||
|
OPI_TestDataRetrieval.Check_String(Response, Data);
|
||||||
|
|
||||||
|
Connection = OPI_TCP.CreateConnection(Address);
|
||||||
|
|
||||||
|
OPI_TCP.SendLine(Connection, Data);
|
||||||
|
Result = OPI_TCP.ReadLine(Connection, , , 50000);
|
||||||
|
|
||||||
|
OPI_TCP.CloseConnection(Connection);
|
||||||
|
|
||||||
|
OPI_TestDataRetrieval.WriteLog(Result, "SendLine (timeout)", "TCP");
|
||||||
|
OPI_TestDataRetrieval.Check_String(Result, Data);
|
||||||
|
|
||||||
|
EndProcedure
|
||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
@ -15790,7 +15790,7 @@
|
|||||||
|
|
||||||
Адрес = ПараметрыФункции["TCP_Address"];
|
Адрес = ПараметрыФункции["TCP_Address"];
|
||||||
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
||||||
Данные = "Hello server!" + Символы.ПС;
|
Данные = "Hello server!" + Символы.ПС;
|
||||||
|
|
||||||
OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
||||||
|
|
||||||
@ -15822,7 +15822,7 @@
|
|||||||
|
|
||||||
Адрес = ПараметрыФункции["TCP_Address"];
|
Адрес = ПараметрыФункции["TCP_Address"];
|
||||||
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
||||||
Данные = "Hello server!" + Символы.ПС;
|
Данные = "Hello server!" + Символы.ПС;
|
||||||
|
|
||||||
Результат = OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
Результат = OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -2060,9 +2060,9 @@
|
|||||||
КонецФункции
|
КонецФункции
|
||||||
|
|
||||||
Функция ПолучитьОбщийМодуль(Знач Имя)
|
Функция ПолучитьОбщийМодуль(Знач Имя)
|
||||||
|
|
||||||
Модуль = Вычислить(Имя);
|
Модуль = Вычислить(Имя);
|
||||||
|
|
||||||
Возврат Модуль;
|
Возврат Модуль;
|
||||||
КонецФункции
|
КонецФункции
|
||||||
|
|
||||||
|
@ -15790,7 +15790,7 @@
|
|||||||
|
|
||||||
Адрес = ПараметрыФункции["TCP_Address"];
|
Адрес = ПараметрыФункции["TCP_Address"];
|
||||||
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
||||||
Данные = "Hello server!" + Символы.ПС;
|
Данные = "Hello server!" + Символы.ПС;
|
||||||
|
|
||||||
OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
||||||
|
|
||||||
@ -15822,7 +15822,7 @@
|
|||||||
|
|
||||||
Адрес = ПараметрыФункции["TCP_Address"];
|
Адрес = ПараметрыФункции["TCP_Address"];
|
||||||
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
Соединение = OPI_TCP.ОткрытьСоединение(Адрес);
|
||||||
Данные = "Hello server!" + Символы.ПС;
|
Данные = "Hello server!" + Символы.ПС;
|
||||||
|
|
||||||
Результат = OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
Результат = OPI_TCP.ОтправитьСтроку(Соединение, Данные);
|
||||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
Loading…
x
Reference in New Issue
Block a user