Script for creating a guaranteed connection pool for MyChat Integration API services
Posted: Mon Dec 16, 2019 2:50 pm
The task: a company with MyChat Server for 150 connections uses 1C:Enterprise notification system for employees. MyChat Server is "full", and there are no free connections.
The company plans to purchase MyChat Server license extension, but for now, you need to provide a trouble proof notification system that would work even if there are no free connections left.
The script is set on OnClientConnect event, and gives a guaranteed pool of free connections for a specified IP address that used for sending notifications from 1C:
Script source:
The company plans to purchase MyChat Server license extension, but for now, you need to provide a trouble proof notification system that would work even if there are no free connections left.
The script is set on OnClientConnect event, and gives a guaranteed pool of free connections for a specified IP address that used for sending notifications from 1C:
Script source:
Code: Select all
function OnClientConnect(iCID: integer; sIP: string; iMajorVer, iMinorVer: integer): boolean;
var
iMax, iCurrent: integer;
bFlag: boolean;
begin
bFlag := true;
iCurrent := mGetServerTechInfoInt(0);
iMax := mGetServerTechInfoInt(1);
if ((iMax - iCurrent) <= 5) and (sIP <> '192.168.10.1') then bFlag := false;
result := bFlag;
end;
begin
end.