⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msgconst.pas

📁 Delphi MsgCommunicator 2-10 component.I ve used, really good job. can be Server-Client message appl
💻 PAS
📖 第 1 页 / 共 2 页
字号:
unit MsgConst;

interface

uses  SysUtils;

{$I MsgVer.inc}

{$I MsgErrorL.inc}
{$I MsgErrorR.inc}

type  TMsgSignature = Array [0..3] of Char;

{$IFDEF MsgCommunicator}
// const MsgVersionText = 'Prerelease version #2';
 const MsgVersionText = '';
 const MsgVersion = 2.10;
{$ENDIF}

const crlf = #13#10;
const MsgServerConfigFileExtension = '.ini';
{$IFDEF TRIAL_VERSION}
 {$IFDEF TRIAL_VERSION_WITHOUT_NAG_SCREEN}
    MsgBuildInfo = 'Trial Without Nag-Screen';
 {$ELSE}
    MsgBuildInfo = 'Trial With Nag-Screen';
 {$ENDIF}
{$ELSE}
 MsgBuildInfo = 'Full';
{$ENDIF}


//------------------------------------------------------------------------------
// MsgVariant
//------------------------------------------------------------------------------
{$IFDEF LINUX}
// const MAX_INTEGER = 2147483647;
 const MAX_STRING_LENGTH = 99 * 1024; // To avoid memory problem with old libc.so
// 4 * 1024 * 1024 - 4 - 1;  // WideUpperCase works slow
// 2147483647 div 32 - 4; // really works, but too slow
{$ENDIF}
 const MsgExpressionMaxStringSize = 255;

//------------------------------------------------------------------------------
// Connection consts
//------------------------------------------------------------------------------

// Maximum threads number
 MsgMaxThreadCount = 100;

//------------------------------------------------------------------------------

// Allow connection parameters auto correction
 MsgConnectionParamsTunning = False;
// MsgConnectionParamsTunning = True;

// Number of packets to test network for connection parameters auto tunning
 MsgTestPacketCount = 8;

// To connect - Client only
 MsgConnectRetryCount = 20;       // - Client only
 MsgConnectDelay = 500;            // - Client only

// To receive full session buffer
 MsgStartReceiveTimeOut = 60000;    // - Client only, time to wait for the first packet in answer
 MsgReceiveTimeOut = 600000;        // - Client only, time since the first packet to the latest
 MsgReceiveSleep = 1;               // - Client only, time to sleep while receive buffer to allow incoming packets processing, >=0, <= 100
 MsgServerReceiveTimeOut = 300000;  // - Server only
 MsgServerReceiveSleep = 1;         // - Server only   >=0, <= 100

// To send buffer
 MsgMinSendTimeOut =       10000;        // - Client only
{$IFDEF MsgCommunicator}
 MsgSendTimeOut =          10000;        // - Client only
{$ELSE}
 MsgSendTimeOut =         180000;        // - Client only
{$ENDIF}
 MsgMinServerSendTimeOut = 60000;        // - Server only
 MsgServerSendTimeOut   = 600000;        // - Server only

// To send new request to ask other side to resend broken packet
 MsgWaitForSendSleep = 0;        // - Client only, time to sleep while wait for all packets being sent in packet resending, =0 for best speed
 MsgResendDelay = 300;           // - Client only, delay (msec) before resend requested packet, >=1, <= 100
 MsgRequestDelay = 300;          // - Client only, delay (msec) before request lost packet, >=1, <= 100
 MsgServerWaitForSendSleep = 0;  // - Server only, =0 for best speed
 MsgServerResendDelay = 200;     // - Server only, >0, <= 100
 MsgServerRequestDelay = 100;    // - Server only, >=0, <= 100

// To Diconnect
 MsgDisconnectRetryCount = 12;   // Both Client and Server
 MsgDisconnectDelay = 300;       // Both Client and Server

//------------------------------------------------------------------------------

// Wait for end of all other sessions messages sending
 MsgWaitForMessagesSend = 300000;   // Server only

// Wait for Session finishing
{$IFDEF MsgCommunicator}
 MsgWaitForTimeOut =   5000;        // Client only
{$ELSE}
 MsgWaitForTimeOut = 120000;        // Client only
{$ENDIF}
// Wait for Server Session Thread finishing
 MsgWaitForServerSessionThreadTimeOut = 120000;    // Server only

// Wait for other threads finish to free shared object
{$IFDEF MsgCommunicator}
 MsgThreadsTerminateDelay =       3000;   // Client
{$ELSE}
 MsgThreadsTerminateDelay =      30000;   // Client
{$ENDIF} 
 MsgServerThreadsTerminateDelay = 1000;   // Server
 
// Pause between loops
 MsgServerSessionTerminatorSleep = 100; // Server 
	
// Enable/Disable disconect by timeout
 MsgPingClients = True;        // Server
// Wait for alive confirmation
{$IFDEF MsgCommunicator} 
 MsgWaitForPingAnswer = 30000; // Server
{$ELSE}
 MsgWaitForPingAnswer = 60000; // Server
{$ENDIF} 
// Pause between pings
 MsgServerPingSleep      = 20; // Server, >=1, low priority thread 
 
//------------------------------------------------------------------------------
 
//------------------------------------------------------------------------------ 
 
 const MsgMinPacketSize = 128;  // PacketHeader = 33
 const MsgMaxPacketSize = 65507;    // 65507 - maximum allowed //64512;//32768;//16384;
 const MsgDefaultPacketSize = 8192;
 const MsgDefaultClientPort = 12008; 
 const MsgDefaultServerPort = 12007;// Cannot be the same as MsgDefaultClientPort
 
 const MsgDefaultAuthorizationBufferSize = 512; 
 const MsgDefaultServerID = 0; 
 const MsgDefaultHost = '127.0.0.1';  // 'localhost' - delay about 100 msec to resolve
 const MsgDefaultServerHost = '';     // 'localhost' - delay about 100 msec to resolve
 
{$IFDEF MsgCommunicator} 
 const MsgDefaultServerConfigFileName = 'MsgServer.ini';
 const MsgServerDescription = 'MsgCommunicator Server';
{$ELSE}
 const MsgServerDescription = 'MsgCommunicator Database Server';
 const MsgDefaultServerConfigFileName = 'MsgCommunicatorDatabaseServer.ini';
 const MsgDefaultDBName = 'DBDemos'; 
 const MsgDefaultDBFileName = '..\..\..\Demos\Data\DBDemos.adb'; 
{$ENDIF}
	
	
{******************************************************************************}
 
//------------------------------------------------------------------------------ 
// disk consts 
//------------------------------------------------------------------------------ 
 
{$IFDEF LINUX}
 const INVALID_FILE_SIZE = -1;
 const INVALID_HANDLE_VALUE = -1;
{$ENDIF} 
 var MsgDefaultTempDir: String;
 const MsgDefaultRetryCount = 10;
 const MsgDefaultDelay = 500; // ms 
 const MsgMinRetryCount = 10; 
 const MsgMinDelay = 0;
 const MsgMAXLastLockRetryTime = 2000; // ms 
 const MsgMAXLockFileTime = 2500; // ms  > MsgMAXLastLockRetryTime
 {$IFDEF TRIAL_VERSION}
 const MsgMaxSingleUserConnections = 5;
 {$ELSE} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -