Bind port (PULL)
Bind pipeline port for receiving data
- Parameters
- Advanced call ?
Function BindPortPull(Val Port, Val Logging = Undefined) Export
| Parameter | CLI option | Type | Required | Description |
|---|---|---|---|---|
| Port | --port | Number | ✔ | Target port |
| Logging | --log | Structure Of KeyAndValue | ✖ | Logging settings. See GetLoggingSettings |
Returns
Map Of KeyAndValue, Arbitrary - AddIn object or map with error information
| Parameter | Description |
|---|---|
| addin_mode | Manual selection of external component connection mode (for 1C): Isolated, NotIsolated |
| dontwait | Creates a background job and returns its data (for 1C and OneScript only) |
1C:Enterprise/OneScript code example
// Host
Port = 5555;
ServerObject = OPI_ZeroMQ.BindPortPull(Port);
If Not OPI_ZeroMQ.IsConnectorObject(ServerObject) Then
Raise OPI_Tools.JSONString(ServerObject);
EndIf;
// Client
Address = "tcp://127.0.0.1:5555";
ClientObject = OPI_ZeroMQ.CreateConnectionPush(Address);
If Not OPI_ZeroMQ.IsConnectorObject(ClientObject) Then
Raise OPI_Tools.JSONString(ClientObject);
EndIf;
Message = StrTemplate("ZMQ_B_PULL_%1", Format(CurrentDate(), "DF=yyyyMMddhhmmss"));
Data = GetBinaryDataFromString(Message);
Result
"AddIn.OPI_ZeroMQ.Main"