unit Chilkat.Socket;

{
  Pascal wrapper for Chilkat Socket.
  Auto-generated by PascalWrapperGenerator -- do not edit manually.
}

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}

interface

uses
  SysUtils,
  Chilkat.Base;

type

  { TSocket wraps CkSocket via the C bridge layer. }
  TSocket = class(TChilkatBase)
  private
    FOnAbortCheck: TChilkatAbortCheckEvent;
    FOnPercentDone: TChilkatPercentDoneEvent;
    FOnProgressInfo: TChilkatProgressInfoEvent;
    function  GetLastErrorHtml: string;
    function  GetLastErrorText: string;
    function  GetLastErrorXml: string;
    function  GetVersion: string;
    function  GetDebugLogFilePath: string;
    procedure SetDebugLogFilePath(AValue: string);
    function  GetVerboseLogging: Boolean;
    procedure SetVerboseLogging(AValue: Boolean);
    function  GetLastMethodSuccess: Boolean;
    procedure SetLastMethodSuccess(AValue: Boolean);
    function  GetAbortCurrent: Boolean;
    procedure SetAbortCurrent(AValue: Boolean);
    function  GetAcceptFailReason: Integer;
    function  GetBandwidthThrottleDown: Integer;
    procedure SetBandwidthThrottleDown(AValue: Integer);
    function  GetBandwidthThrottleUp: Integer;
    procedure SetBandwidthThrottleUp(AValue: Integer);
    function  GetBigEndian: Boolean;
    procedure SetBigEndian(AValue: Boolean);
    function  GetClientIpAddress: string;
    procedure SetClientIpAddress(AValue: string);
    function  GetClientPort: Integer;
    procedure SetClientPort(AValue: Integer);
    function  GetConnectFailReason: Integer;
    function  GetElapsedSeconds: Integer;
    function  GetHeartbeatMs: Integer;
    procedure SetHeartbeatMs(AValue: Integer);
    function  GetHttpProxyAuthMethod: string;
    procedure SetHttpProxyAuthMethod(AValue: string);
    function  GetHttpProxyDomain: string;
    procedure SetHttpProxyDomain(AValue: string);
    function  GetHttpProxyHostname: string;
    procedure SetHttpProxyHostname(AValue: string);
    function  GetHttpProxyPassword: string;
    procedure SetHttpProxyPassword(AValue: string);
    function  GetHttpProxyPort: Integer;
    procedure SetHttpProxyPort(AValue: Integer);
    function  GetHttpProxyUsername: string;
    procedure SetHttpProxyUsername(AValue: string);
    function  GetIsConnected: Boolean;
    function  GetKeepAlive: Boolean;
    procedure SetKeepAlive(AValue: Boolean);
    function  GetKeepSessionLog: Boolean;
    procedure SetKeepSessionLog(AValue: Boolean);
    function  GetLastMethodFailed: Boolean;
    function  GetLocalIpAddress: string;
    function  GetLocalPort: Integer;
    function  GetMaxReadIdleMs: Integer;
    procedure SetMaxReadIdleMs(AValue: Integer);
    function  GetMaxSendIdleMs: Integer;
    procedure SetMaxSendIdleMs(AValue: Integer);
    function  GetMyIpAddress: string;
    function  GetNumReceivedClientCerts: Integer;
    function  GetNumSocketsInSet: Integer;
    function  GetNumSslAcceptableClientCAs: Integer;
    function  GetObjectId: Integer;
    function  GetPercentDoneScale: Integer;
    procedure SetPercentDoneScale(AValue: Integer);
    function  GetPreferIpv6: Boolean;
    procedure SetPreferIpv6(AValue: Boolean);
    function  GetReceiveFailReason: Integer;
    function  GetReceivePacketSize: Integer;
    procedure SetReceivePacketSize(AValue: Integer);
    function  GetReceivedCount: Integer;
    procedure SetReceivedCount(AValue: Integer);
    function  GetReceivedInt: Integer;
    procedure SetReceivedInt(AValue: Integer);
    function  GetRemoteIpAddress: string;
    function  GetRemotePort: Integer;
    function  GetRequireSslCertVerify: Boolean;
    procedure SetRequireSslCertVerify(AValue: Boolean);
    function  GetSelectorIndex: Integer;
    procedure SetSelectorIndex(AValue: Integer);
    function  GetSelectorReadIndex: Integer;
    procedure SetSelectorReadIndex(AValue: Integer);
    function  GetSelectorWriteIndex: Integer;
    procedure SetSelectorWriteIndex(AValue: Integer);
    function  GetSendFailReason: Integer;
    function  GetSendPacketSize: Integer;
    procedure SetSendPacketSize(AValue: Integer);
    function  GetSessionLog: string;
    function  GetSessionLogEncoding: string;
    procedure SetSessionLogEncoding(AValue: string);
    function  GetSoRcvBuf: Integer;
    procedure SetSoRcvBuf(AValue: Integer);
    function  GetSoReuseAddr: Boolean;
    procedure SetSoReuseAddr(AValue: Boolean);
    function  GetSoSndBuf: Integer;
    procedure SetSoSndBuf(AValue: Integer);
    function  GetSocksHostname: string;
    procedure SetSocksHostname(AValue: string);
    function  GetSocksPassword: string;
    procedure SetSocksPassword(AValue: string);
    function  GetSocksPort: Integer;
    procedure SetSocksPort(AValue: Integer);
    function  GetSocksUsername: string;
    procedure SetSocksUsername(AValue: string);
    function  GetSocksVersion: Integer;
    procedure SetSocksVersion(AValue: Integer);
    function  GetSsl: Boolean;
    procedure SetSsl(AValue: Boolean);
    function  GetSslAllowedCiphers: string;
    procedure SetSslAllowedCiphers(AValue: string);
    function  GetSslProtocol: string;
    procedure SetSslProtocol(AValue: string);
    function  GetStringCharset: string;
    procedure SetStringCharset(AValue: string);
    function  GetTcpNoDelay: Boolean;
    procedure SetTcpNoDelay(AValue: Boolean);
    function  GetTlsCipherSuite: string;
    function  GetTlsPinSet: string;
    procedure SetTlsPinSet(AValue: string);
    function  GetTlsVersion: string;
    function  GetUserData: string;
    procedure SetUserData(AValue: string);
    function  GetListenPort: Integer;
    function  GetHttpProxyForHttp: Boolean;
    procedure SetHttpProxyForHttp(AValue: Boolean);
    function  GetRcvBytesPerSec: Integer;
    function  GetSendBytesPerSec: Integer;
    function  GetUncommonOptions: string;
    procedure SetUncommonOptions(AValue: string);
    function  GetAlpnProtocol: string;
    procedure SetAlpnProtocol(AValue: string);
    function  GetSniHostname: string;
    procedure SetSniHostname(AValue: string);
    function  GetNumBytesAvailable: Integer;
    procedure SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
    procedure SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
    procedure SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
  public
    constructor Create;
    destructor  Destroy; override;

    property LastErrorHtml: string read GetLastErrorHtml;
    property LastErrorText: string read GetLastErrorText;
    property LastErrorXml: string read GetLastErrorXml;
    property Version: string read GetVersion;
    property DebugLogFilePath: string read GetDebugLogFilePath write SetDebugLogFilePath;
    property VerboseLogging: Boolean read GetVerboseLogging write SetVerboseLogging;
    property LastMethodSuccess: Boolean read GetLastMethodSuccess write SetLastMethodSuccess;
    property AbortCurrent: Boolean read GetAbortCurrent write SetAbortCurrent;
    property AcceptFailReason: Integer read GetAcceptFailReason;
    property BandwidthThrottleDown: Integer read GetBandwidthThrottleDown write SetBandwidthThrottleDown;
    property BandwidthThrottleUp: Integer read GetBandwidthThrottleUp write SetBandwidthThrottleUp;
    property BigEndian: Boolean read GetBigEndian write SetBigEndian;
    property ClientIpAddress: string read GetClientIpAddress write SetClientIpAddress;
    property ClientPort: Integer read GetClientPort write SetClientPort;
    property ConnectFailReason: Integer read GetConnectFailReason;
    property ElapsedSeconds: Integer read GetElapsedSeconds;
    property HeartbeatMs: Integer read GetHeartbeatMs write SetHeartbeatMs;
    property HttpProxyAuthMethod: string read GetHttpProxyAuthMethod write SetHttpProxyAuthMethod;
    property HttpProxyDomain: string read GetHttpProxyDomain write SetHttpProxyDomain;
    property HttpProxyHostname: string read GetHttpProxyHostname write SetHttpProxyHostname;
    property HttpProxyPassword: string read GetHttpProxyPassword write SetHttpProxyPassword;
    property HttpProxyPort: Integer read GetHttpProxyPort write SetHttpProxyPort;
    property HttpProxyUsername: string read GetHttpProxyUsername write SetHttpProxyUsername;
    property IsConnected: Boolean read GetIsConnected;
    property KeepAlive: Boolean read GetKeepAlive write SetKeepAlive;
    property KeepSessionLog: Boolean read GetKeepSessionLog write SetKeepSessionLog;
    property LastMethodFailed: Boolean read GetLastMethodFailed;
    property LocalIpAddress: string read GetLocalIpAddress;
    property LocalPort: Integer read GetLocalPort;
    property MaxReadIdleMs: Integer read GetMaxReadIdleMs write SetMaxReadIdleMs;
    property MaxSendIdleMs: Integer read GetMaxSendIdleMs write SetMaxSendIdleMs;
    property MyIpAddress: string read GetMyIpAddress;
    property NumReceivedClientCerts: Integer read GetNumReceivedClientCerts;
    property NumSocketsInSet: Integer read GetNumSocketsInSet;
    property NumSslAcceptableClientCAs: Integer read GetNumSslAcceptableClientCAs;
    property ObjectId: Integer read GetObjectId;
    property PercentDoneScale: Integer read GetPercentDoneScale write SetPercentDoneScale;
    property PreferIpv6: Boolean read GetPreferIpv6 write SetPreferIpv6;
    property ReceiveFailReason: Integer read GetReceiveFailReason;
    property ReceivePacketSize: Integer read GetReceivePacketSize write SetReceivePacketSize;
    property ReceivedCount: Integer read GetReceivedCount write SetReceivedCount;
    property ReceivedInt: Integer read GetReceivedInt write SetReceivedInt;
    property RemoteIpAddress: string read GetRemoteIpAddress;
    property RemotePort: Integer read GetRemotePort;
    property RequireSslCertVerify: Boolean read GetRequireSslCertVerify write SetRequireSslCertVerify;
    property SelectorIndex: Integer read GetSelectorIndex write SetSelectorIndex;
    property SelectorReadIndex: Integer read GetSelectorReadIndex write SetSelectorReadIndex;
    property SelectorWriteIndex: Integer read GetSelectorWriteIndex write SetSelectorWriteIndex;
    property SendFailReason: Integer read GetSendFailReason;
    property SendPacketSize: Integer read GetSendPacketSize write SetSendPacketSize;
    property SessionLog: string read GetSessionLog;
    property SessionLogEncoding: string read GetSessionLogEncoding write SetSessionLogEncoding;
    property SoRcvBuf: Integer read GetSoRcvBuf write SetSoRcvBuf;
    property SoReuseAddr: Boolean read GetSoReuseAddr write SetSoReuseAddr;
    property SoSndBuf: Integer read GetSoSndBuf write SetSoSndBuf;
    property SocksHostname: string read GetSocksHostname write SetSocksHostname;
    property SocksPassword: string read GetSocksPassword write SetSocksPassword;
    property SocksPort: Integer read GetSocksPort write SetSocksPort;
    property SocksUsername: string read GetSocksUsername write SetSocksUsername;
    property SocksVersion: Integer read GetSocksVersion write SetSocksVersion;
    property Ssl: Boolean read GetSsl write SetSsl;
    property SslAllowedCiphers: string read GetSslAllowedCiphers write SetSslAllowedCiphers;
    property SslProtocol: string read GetSslProtocol write SetSslProtocol;
    property StringCharset: string read GetStringCharset write SetStringCharset;
    property TcpNoDelay: Boolean read GetTcpNoDelay write SetTcpNoDelay;
    property TlsCipherSuite: string read GetTlsCipherSuite;
    property TlsPinSet: string read GetTlsPinSet write SetTlsPinSet;
    property TlsVersion: string read GetTlsVersion;
    property UserData: string read GetUserData write SetUserData;
    property ListenPort: Integer read GetListenPort;
    property HttpProxyForHttp: Boolean read GetHttpProxyForHttp write SetHttpProxyForHttp;
    property RcvBytesPerSec: Integer read GetRcvBytesPerSec;
    property SendBytesPerSec: Integer read GetSendBytesPerSec;
    property UncommonOptions: string read GetUncommonOptions write SetUncommonOptions;
    property AlpnProtocol: string read GetAlpnProtocol write SetAlpnProtocol;
    property SniHostname: string read GetSniHostname write SetSniHostname;
    property NumBytesAvailable: Integer read GetNumBytesAvailable;

    { Event callbacks.  Return True from OnAbortCheck / OnPercentDone
      to abort the running method.  Callbacks are invoked on the
      thread that called the Chilkat method.  The HeartbeatMs
      property controls the AbortCheck frequency. }
    property OnAbortCheck: TChilkatAbortCheckEvent read FOnAbortCheck write SetOnAbortCheck;
    property OnPercentDone: TChilkatPercentDoneEvent read FOnPercentDone write SetOnPercentDone;
    property OnProgressInfo: TChilkatProgressInfoEvent read FOnProgressInfo write SetOnProgressInfo;

    function  AddSslAcceptableClientCaDn(const certAuthDN: string): Boolean;
    function  BindAndListen(port: Integer; backLog: Integer): Boolean;
    function  BuildHttpGetRequest(const url: string): string;
    function  CheckWriteable(maxWaitMs: Integer): Integer;
    procedure ClearSessionLog;
    function  Close(maxWaitMs: Integer): Boolean;
    function  Connect(const hostname: string; port: Integer; ssl: Boolean; maxWaitMs: Integer): Boolean;
    function  ConvertFromSsl: Boolean;
    function  ConvertToSsl: Boolean;
    procedure DnsCacheClear;
    function  DnsLookup(const hostname: string; maxWaitMs: Integer): string;
    function  GetSslAcceptableClientCaDn(index: Integer): string;
    function  InitSslServer(cert: TChilkatBase): Boolean;
    function  PollDataAvailable: Boolean;
    function  ReceiveByte(bUnsigned: Boolean): Boolean;
    function  ReceiveBytesENC(const encodingAlg: string): string;
    function  ReceiveBytesToFile(const appendFilename: string): Boolean;
    function  ReceiveCount: Integer;
    function  ReceiveInt16(bigEndian: Boolean; bUnsigned: Boolean): Boolean;
    function  ReceiveInt32(bigEndian: Boolean): Boolean;
    function  ReceiveNBytesENC(numBytes: LongWord; const encodingAlg: string): string;
    function  ReceiveString: string;
    function  ReceiveStringMaxN(maxByteCount: Integer): string;
    function  ReceiveStringUntilByte(lookForByte: Integer): string;
    function  ReceiveToCRLF: string;
    function  ReceiveUntilMatch(const matchStr: string): string;
    function  SelectForReading(timeoutMs: Integer): Integer;
    function  SelectForWriting(timeoutMs: Integer): Integer;
    function  SendByte(value: Integer): Boolean;
    function  SendBytesENC(const encodedBytes: string; const encodingAlg: string): Boolean;
    function  SendCount(byteCount: Integer): Boolean;
    function  SendInt16(value: Integer; bigEndian: Boolean): Boolean;
    function  SendInt32(value: Integer; bigEndian: Boolean): Boolean;
    function  SendString(const stringToSend: string): Boolean;
    function  SetSslClientCert(cert: TChilkatBase): Boolean;
    function  SetSslClientCertPem(const pemDataOrFilename: string; const pemPassword: string): Boolean;
    function  SetSslClientCertPfx(const pfxFilename: string; const pfxPassword: string): Boolean;
    procedure SleepMs(millisec: Integer);
    function  SshAuthenticatePk(const sshLogin: string; privateKey: TChilkatBase): Boolean;
    function  SshAuthenticatePw(const sshLogin: string; const sshPassword: string): Boolean;
    function  SshCloseTunnel: Boolean;
    function  SshOpenTunnel(const sshHostname: string; sshPort: Integer): Boolean;
    procedure StartTiming;
    function  TakeSocket(sock: TChilkatBase): Boolean;
    function  TlsRenegotiate: Boolean;
    function  UseSsh(ssh: TChilkatBase): Boolean;
    function  ReceiveBd(binData: TChilkatBase): Boolean;
    function  ReceiveSb(sb: TChilkatBase): Boolean;
    function  SendBd(binData: TChilkatBase; offset: LongWord; numBytes: LongWord): Boolean;
    function  SendSb(sb: TChilkatBase): Boolean;
    function  ReceiveBdN(numBytes: LongWord; binData: TChilkatBase): Boolean;
    function  SendWakeOnLan(const macAddress: string; port: Integer; const ipBroadcastAddr: string): Boolean;
    function  BindAndListenPortRange(beginPort: Integer; endPort: Integer; backLog: Integer): Integer;
    function  ReceiveUntilByteBd(lookForByte: Integer; bd: TChilkatBase): Boolean;
    function  SendWakeOnLan2(const macAddress: string; port: Integer; const ipBroadcastAddr: string; const password: string): Boolean;
    function  TakeConnection(sock: TChilkatBase): Boolean;
    procedure ResetPerf(rcvPerf: Boolean);
    function  SendBytes2(pByteData: Pointer; szByteData: LongWord): Boolean;
    function  ReceiveUntilMatchSb(const matchStr: string; sb: TChilkatBase): Boolean;
    function  GetAdaptersAddresses(json: TChilkatBase): Boolean;
    procedure GetLastJsonData(json: TChilkatBase);
    function  GetServerCert(cert: TChilkatBase): Boolean;
    function  AcceptNext(maxWaitMs: Integer; socket: TChilkatBase): Boolean;
    function  DupSocket(dest: TChilkatBase): Boolean;
    function  GetMyServerCert(cert: TChilkatBase): Boolean;
    function  GetRcvdClientCert(index: Integer; cert: TChilkatBase): Boolean;
    function  SshNewChannel(const hostname: string; port: Integer; ssl: Boolean; maxWaitMs: Integer; channel: TChilkatBase): Boolean;
  end;

implementation

uses
  CkDllLoader,
  Chilkat.Utils;

{ ---- C bridge function pointer types ---- }
type
  TCkSocket_Create  = function(): Pointer; cdecl;
  TCkSocket_Dispose = procedure(handle: Pointer); cdecl;
  TCkBridgeAbortCheckCb   = function(userData: Pointer): Integer; cdecl;
  TCkBridgePercentDoneCb  = function(pctDone: Integer; userData: Pointer): Integer; cdecl;
  TCkBridgeProgressInfoCb = procedure(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
  TCkSocket_SetAbortCheckCallback   = procedure(handle: Pointer; cb: TCkBridgeAbortCheckCb; userData: Pointer); cdecl;
  TCkSocket_SetPercentDoneCallback  = procedure(handle: Pointer; cb: TCkBridgePercentDoneCb; userData: Pointer); cdecl;
  TCkSocket_SetProgressInfoCallback = procedure(handle: Pointer; cb: TCkBridgeProgressInfoCb; userData: Pointer); cdecl;
  TCkSocket_get_LastErrorHtml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_LastErrorText = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_LastErrorXml = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_Version = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_DebugLogFilePath = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_DebugLogFilePath = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_VerboseLogging = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_VerboseLogging = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_LastMethodSuccess = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_LastMethodSuccess = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_AbortCurrent = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_AbortCurrent = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_AcceptFailReason = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_BandwidthThrottleDown = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_BandwidthThrottleDown = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_BandwidthThrottleUp = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_BandwidthThrottleUp = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_BigEndian = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_BigEndian = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_ClientIpAddress = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_ClientIpAddress = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_ClientPort = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_ClientPort = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_ConnectFailReason = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_ElapsedSeconds = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_HeartbeatMs = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_HeartbeatMs = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_HttpProxyAuthMethod = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_HttpProxyAuthMethod = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_HttpProxyDomain = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_HttpProxyDomain = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_HttpProxyHostname = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_HttpProxyHostname = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_HttpProxyPassword = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_HttpProxyPassword = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_HttpProxyPort = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_HttpProxyPort = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_HttpProxyUsername = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_HttpProxyUsername = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_IsConnected = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_get_KeepAlive = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_KeepAlive = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_KeepSessionLog = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_KeepSessionLog = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_LastMethodFailed = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_get_LocalIpAddress = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_LocalPort = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_MaxReadIdleMs = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_MaxReadIdleMs = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_MaxSendIdleMs = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_MaxSendIdleMs = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_MyIpAddress = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_NumReceivedClientCerts = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_NumSocketsInSet = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_NumSslAcceptableClientCAs = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_ObjectId = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_PercentDoneScale = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_PercentDoneScale = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_PreferIpv6 = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_PreferIpv6 = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_ReceiveFailReason = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_ReceivePacketSize = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_ReceivePacketSize = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_ReceivedCount = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_ReceivedCount = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_ReceivedInt = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_ReceivedInt = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_RemoteIpAddress = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_RemotePort = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_RequireSslCertVerify = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_RequireSslCertVerify = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_SelectorIndex = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_SelectorIndex = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_SelectorReadIndex = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_SelectorReadIndex = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_SelectorWriteIndex = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_SelectorWriteIndex = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_SendFailReason = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_SendPacketSize = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_SendPacketSize = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_SessionLog = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_SessionLogEncoding = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_SessionLogEncoding = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_SoRcvBuf = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_SoRcvBuf = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_SoReuseAddr = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_SoReuseAddr = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_SoSndBuf = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_SoSndBuf = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_SocksHostname = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_SocksHostname = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_SocksPassword = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_SocksPassword = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_SocksPort = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_SocksPort = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_SocksUsername = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_SocksUsername = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_SocksVersion = function(handle: Pointer): Integer; cdecl;
  TCkSocket_put_SocksVersion = procedure(handle: Pointer; value: Integer); cdecl;
  TCkSocket_get_Ssl = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_Ssl = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_SslAllowedCiphers = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_SslAllowedCiphers = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_SslProtocol = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_SslProtocol = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_StringCharset = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_StringCharset = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_TcpNoDelay = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_TcpNoDelay = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_TlsCipherSuite = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_TlsPinSet = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_TlsPinSet = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_TlsVersion = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_get_UserData = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_UserData = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_ListenPort = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_HttpProxyForHttp = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_put_HttpProxyForHttp = procedure(handle: Pointer; value: LongBool); cdecl;
  TCkSocket_get_RcvBytesPerSec = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_SendBytesPerSec = function(handle: Pointer): Integer; cdecl;
  TCkSocket_get_UncommonOptions = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_UncommonOptions = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_AlpnProtocol = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_AlpnProtocol = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_SniHostname = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_put_SniHostname = procedure(handle: Pointer; value: PAnsiChar); cdecl;
  TCkSocket_get_NumBytesAvailable = function(handle: Pointer): Integer; cdecl;
  TCkSocket_AddSslAcceptableClientCaDn = function(handle: Pointer; certAuthDN: PAnsiChar): LongBool; cdecl;
  TCkSocket_BindAndListen = function(handle: Pointer; port: Integer; backLog: Integer): LongBool; cdecl;
  TCkSocket_BuildHttpGetRequest = function(handle: Pointer; url: PAnsiChar): PAnsiChar; cdecl;
  TCkSocket_CheckWriteable = function(handle: Pointer; maxWaitMs: Integer): Integer; cdecl;
  TCkSocket_ClearSessionLog = procedure(handle: Pointer); cdecl;
  TCkSocket_Close = function(handle: Pointer; maxWaitMs: Integer): LongBool; cdecl;
  TCkSocket_Connect = function(handle: Pointer; hostname: PAnsiChar; port: Integer; ssl: LongBool; maxWaitMs: Integer): LongBool; cdecl;
  TCkSocket_ConvertFromSsl = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_ConvertToSsl = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_DnsCacheClear = procedure(handle: Pointer); cdecl;
  TCkSocket_DnsLookup = function(handle: Pointer; hostname: PAnsiChar; maxWaitMs: Integer): PAnsiChar; cdecl;
  TCkSocket_GetSslAcceptableClientCaDn = function(handle: Pointer; index: Integer): PAnsiChar; cdecl;
  TCkSocket_InitSslServer = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkSocket_PollDataAvailable = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_ReceiveByte = function(handle: Pointer; bUnsigned: LongBool): LongBool; cdecl;
  TCkSocket_ReceiveBytesENC = function(handle: Pointer; encodingAlg: PAnsiChar): PAnsiChar; cdecl;
  TCkSocket_ReceiveBytesToFile = function(handle: Pointer; appendFilename: PAnsiChar): LongBool; cdecl;
  TCkSocket_ReceiveCount = function(handle: Pointer): Integer; cdecl;
  TCkSocket_ReceiveInt16 = function(handle: Pointer; bigEndian: LongBool; bUnsigned: LongBool): LongBool; cdecl;
  TCkSocket_ReceiveInt32 = function(handle: Pointer; bigEndian: LongBool): LongBool; cdecl;
  TCkSocket_ReceiveNBytesENC = function(handle: Pointer; numBytes: LongWord; encodingAlg: PAnsiChar): PAnsiChar; cdecl;
  TCkSocket_ReceiveString = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_ReceiveStringMaxN = function(handle: Pointer; maxByteCount: Integer): PAnsiChar; cdecl;
  TCkSocket_ReceiveStringUntilByte = function(handle: Pointer; lookForByte: Integer): PAnsiChar; cdecl;
  TCkSocket_ReceiveToCRLF = function(handle: Pointer): PAnsiChar; cdecl;
  TCkSocket_ReceiveUntilMatch = function(handle: Pointer; matchStr: PAnsiChar): PAnsiChar; cdecl;
  TCkSocket_SelectForReading = function(handle: Pointer; timeoutMs: Integer): Integer; cdecl;
  TCkSocket_SelectForWriting = function(handle: Pointer; timeoutMs: Integer): Integer; cdecl;
  TCkSocket_SendByte = function(handle: Pointer; value: Integer): LongBool; cdecl;
  TCkSocket_SendBytesENC = function(handle: Pointer; encodedBytes: PAnsiChar; encodingAlg: PAnsiChar): LongBool; cdecl;
  TCkSocket_SendCount = function(handle: Pointer; byteCount: Integer): LongBool; cdecl;
  TCkSocket_SendInt16 = function(handle: Pointer; value: Integer; bigEndian: LongBool): LongBool; cdecl;
  TCkSocket_SendInt32 = function(handle: Pointer; value: Integer; bigEndian: LongBool): LongBool; cdecl;
  TCkSocket_SendString = function(handle: Pointer; stringToSend: PAnsiChar): LongBool; cdecl;
  TCkSocket_SetSslClientCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkSocket_SetSslClientCertPem = function(handle: Pointer; pemDataOrFilename: PAnsiChar; pemPassword: PAnsiChar): LongBool; cdecl;
  TCkSocket_SetSslClientCertPfx = function(handle: Pointer; pfxFilename: PAnsiChar; pfxPassword: PAnsiChar): LongBool; cdecl;
  TCkSocket_SleepMs = procedure(handle: Pointer; millisec: Integer); cdecl;
  TCkSocket_SshAuthenticatePk = function(handle: Pointer; sshLogin: PAnsiChar; privateKey: Pointer): LongBool; cdecl;
  TCkSocket_SshAuthenticatePw = function(handle: Pointer; sshLogin: PAnsiChar; sshPassword: PAnsiChar): LongBool; cdecl;
  TCkSocket_SshCloseTunnel = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_SshOpenTunnel = function(handle: Pointer; sshHostname: PAnsiChar; sshPort: Integer): LongBool; cdecl;
  TCkSocket_StartTiming = procedure(handle: Pointer); cdecl;
  TCkSocket_TakeSocket = function(handle: Pointer; sock: Pointer): LongBool; cdecl;
  TCkSocket_TlsRenegotiate = function(handle: Pointer): LongBool; cdecl;
  TCkSocket_UseSsh = function(handle: Pointer; ssh: Pointer): LongBool; cdecl;
  TCkSocket_ReceiveBd = function(handle: Pointer; binData: Pointer): LongBool; cdecl;
  TCkSocket_ReceiveSb = function(handle: Pointer; sb: Pointer): LongBool; cdecl;
  TCkSocket_SendBd = function(handle: Pointer; binData: Pointer; offset: LongWord; numBytes: LongWord): LongBool; cdecl;
  TCkSocket_SendSb = function(handle: Pointer; sb: Pointer): LongBool; cdecl;
  TCkSocket_ReceiveBdN = function(handle: Pointer; numBytes: LongWord; binData: Pointer): LongBool; cdecl;
  TCkSocket_SendWakeOnLan = function(handle: Pointer; macAddress: PAnsiChar; port: Integer; ipBroadcastAddr: PAnsiChar): LongBool; cdecl;
  TCkSocket_BindAndListenPortRange = function(handle: Pointer; beginPort: Integer; endPort: Integer; backLog: Integer): Integer; cdecl;
  TCkSocket_ReceiveUntilByteBd = function(handle: Pointer; lookForByte: Integer; bd: Pointer): LongBool; cdecl;
  TCkSocket_SendWakeOnLan2 = function(handle: Pointer; macAddress: PAnsiChar; port: Integer; ipBroadcastAddr: PAnsiChar; password: PAnsiChar): LongBool; cdecl;
  TCkSocket_TakeConnection = function(handle: Pointer; sock: Pointer): LongBool; cdecl;
  TCkSocket_ResetPerf = procedure(handle: Pointer; rcvPerf: LongBool); cdecl;
  TCkSocket_SendBytes2 = function(handle: Pointer; pByteData: Pointer; szByteData: LongWord): LongBool; cdecl;
  TCkSocket_ReceiveUntilMatchSb = function(handle: Pointer; matchStr: PAnsiChar; sb: Pointer): LongBool; cdecl;
  TCkSocket_GetAdaptersAddresses = function(handle: Pointer; json: Pointer): LongBool; cdecl;
  TCkSocket_GetLastJsonData = procedure(handle: Pointer; json: Pointer); cdecl;
  TCkSocket_GetServerCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkSocket_AcceptNext = function(handle: Pointer; maxWaitMs: Integer; socket: Pointer): LongBool; cdecl;
  TCkSocket_DupSocket = function(handle: Pointer; dest: Pointer): LongBool; cdecl;
  TCkSocket_GetMyServerCert = function(handle: Pointer; cert: Pointer): LongBool; cdecl;
  TCkSocket_GetRcvdClientCert = function(handle: Pointer; index: Integer; cert: Pointer): LongBool; cdecl;
  TCkSocket_SshNewChannel = function(handle: Pointer; hostname: PAnsiChar; port: Integer; ssl: LongBool; maxWaitMs: Integer; channel: Pointer): LongBool; cdecl;

{ ---- C bridge function pointer variables ---- }
var
  CkSocket_Create:  TCkSocket_Create  = nil;
  CkSocket_Dispose: TCkSocket_Dispose = nil;
  CkSocket_SetAbortCheckCallback:   TCkSocket_SetAbortCheckCallback   = nil;
  CkSocket_SetPercentDoneCallback:  TCkSocket_SetPercentDoneCallback  = nil;
  CkSocket_SetProgressInfoCallback: TCkSocket_SetProgressInfoCallback = nil;
  CkSocket_get_LastErrorHtml: TCkSocket_get_LastErrorHtml = nil;
  CkSocket_get_LastErrorText: TCkSocket_get_LastErrorText = nil;
  CkSocket_get_LastErrorXml: TCkSocket_get_LastErrorXml = nil;
  CkSocket_get_Version: TCkSocket_get_Version = nil;
  CkSocket_get_DebugLogFilePath: TCkSocket_get_DebugLogFilePath = nil;
  CkSocket_put_DebugLogFilePath: TCkSocket_put_DebugLogFilePath = nil;
  CkSocket_get_VerboseLogging: TCkSocket_get_VerboseLogging = nil;
  CkSocket_put_VerboseLogging: TCkSocket_put_VerboseLogging = nil;
  CkSocket_get_LastMethodSuccess: TCkSocket_get_LastMethodSuccess = nil;
  CkSocket_put_LastMethodSuccess: TCkSocket_put_LastMethodSuccess = nil;
  CkSocket_get_AbortCurrent: TCkSocket_get_AbortCurrent = nil;
  CkSocket_put_AbortCurrent: TCkSocket_put_AbortCurrent = nil;
  CkSocket_get_AcceptFailReason: TCkSocket_get_AcceptFailReason = nil;
  CkSocket_get_BandwidthThrottleDown: TCkSocket_get_BandwidthThrottleDown = nil;
  CkSocket_put_BandwidthThrottleDown: TCkSocket_put_BandwidthThrottleDown = nil;
  CkSocket_get_BandwidthThrottleUp: TCkSocket_get_BandwidthThrottleUp = nil;
  CkSocket_put_BandwidthThrottleUp: TCkSocket_put_BandwidthThrottleUp = nil;
  CkSocket_get_BigEndian: TCkSocket_get_BigEndian = nil;
  CkSocket_put_BigEndian: TCkSocket_put_BigEndian = nil;
  CkSocket_get_ClientIpAddress: TCkSocket_get_ClientIpAddress = nil;
  CkSocket_put_ClientIpAddress: TCkSocket_put_ClientIpAddress = nil;
  CkSocket_get_ClientPort: TCkSocket_get_ClientPort = nil;
  CkSocket_put_ClientPort: TCkSocket_put_ClientPort = nil;
  CkSocket_get_ConnectFailReason: TCkSocket_get_ConnectFailReason = nil;
  CkSocket_get_ElapsedSeconds: TCkSocket_get_ElapsedSeconds = nil;
  CkSocket_get_HeartbeatMs: TCkSocket_get_HeartbeatMs = nil;
  CkSocket_put_HeartbeatMs: TCkSocket_put_HeartbeatMs = nil;
  CkSocket_get_HttpProxyAuthMethod: TCkSocket_get_HttpProxyAuthMethod = nil;
  CkSocket_put_HttpProxyAuthMethod: TCkSocket_put_HttpProxyAuthMethod = nil;
  CkSocket_get_HttpProxyDomain: TCkSocket_get_HttpProxyDomain = nil;
  CkSocket_put_HttpProxyDomain: TCkSocket_put_HttpProxyDomain = nil;
  CkSocket_get_HttpProxyHostname: TCkSocket_get_HttpProxyHostname = nil;
  CkSocket_put_HttpProxyHostname: TCkSocket_put_HttpProxyHostname = nil;
  CkSocket_get_HttpProxyPassword: TCkSocket_get_HttpProxyPassword = nil;
  CkSocket_put_HttpProxyPassword: TCkSocket_put_HttpProxyPassword = nil;
  CkSocket_get_HttpProxyPort: TCkSocket_get_HttpProxyPort = nil;
  CkSocket_put_HttpProxyPort: TCkSocket_put_HttpProxyPort = nil;
  CkSocket_get_HttpProxyUsername: TCkSocket_get_HttpProxyUsername = nil;
  CkSocket_put_HttpProxyUsername: TCkSocket_put_HttpProxyUsername = nil;
  CkSocket_get_IsConnected: TCkSocket_get_IsConnected = nil;
  CkSocket_get_KeepAlive: TCkSocket_get_KeepAlive = nil;
  CkSocket_put_KeepAlive: TCkSocket_put_KeepAlive = nil;
  CkSocket_get_KeepSessionLog: TCkSocket_get_KeepSessionLog = nil;
  CkSocket_put_KeepSessionLog: TCkSocket_put_KeepSessionLog = nil;
  CkSocket_get_LastMethodFailed: TCkSocket_get_LastMethodFailed = nil;
  CkSocket_get_LocalIpAddress: TCkSocket_get_LocalIpAddress = nil;
  CkSocket_get_LocalPort: TCkSocket_get_LocalPort = nil;
  CkSocket_get_MaxReadIdleMs: TCkSocket_get_MaxReadIdleMs = nil;
  CkSocket_put_MaxReadIdleMs: TCkSocket_put_MaxReadIdleMs = nil;
  CkSocket_get_MaxSendIdleMs: TCkSocket_get_MaxSendIdleMs = nil;
  CkSocket_put_MaxSendIdleMs: TCkSocket_put_MaxSendIdleMs = nil;
  CkSocket_get_MyIpAddress: TCkSocket_get_MyIpAddress = nil;
  CkSocket_get_NumReceivedClientCerts: TCkSocket_get_NumReceivedClientCerts = nil;
  CkSocket_get_NumSocketsInSet: TCkSocket_get_NumSocketsInSet = nil;
  CkSocket_get_NumSslAcceptableClientCAs: TCkSocket_get_NumSslAcceptableClientCAs = nil;
  CkSocket_get_ObjectId: TCkSocket_get_ObjectId = nil;
  CkSocket_get_PercentDoneScale: TCkSocket_get_PercentDoneScale = nil;
  CkSocket_put_PercentDoneScale: TCkSocket_put_PercentDoneScale = nil;
  CkSocket_get_PreferIpv6: TCkSocket_get_PreferIpv6 = nil;
  CkSocket_put_PreferIpv6: TCkSocket_put_PreferIpv6 = nil;
  CkSocket_get_ReceiveFailReason: TCkSocket_get_ReceiveFailReason = nil;
  CkSocket_get_ReceivePacketSize: TCkSocket_get_ReceivePacketSize = nil;
  CkSocket_put_ReceivePacketSize: TCkSocket_put_ReceivePacketSize = nil;
  CkSocket_get_ReceivedCount: TCkSocket_get_ReceivedCount = nil;
  CkSocket_put_ReceivedCount: TCkSocket_put_ReceivedCount = nil;
  CkSocket_get_ReceivedInt: TCkSocket_get_ReceivedInt = nil;
  CkSocket_put_ReceivedInt: TCkSocket_put_ReceivedInt = nil;
  CkSocket_get_RemoteIpAddress: TCkSocket_get_RemoteIpAddress = nil;
  CkSocket_get_RemotePort: TCkSocket_get_RemotePort = nil;
  CkSocket_get_RequireSslCertVerify: TCkSocket_get_RequireSslCertVerify = nil;
  CkSocket_put_RequireSslCertVerify: TCkSocket_put_RequireSslCertVerify = nil;
  CkSocket_get_SelectorIndex: TCkSocket_get_SelectorIndex = nil;
  CkSocket_put_SelectorIndex: TCkSocket_put_SelectorIndex = nil;
  CkSocket_get_SelectorReadIndex: TCkSocket_get_SelectorReadIndex = nil;
  CkSocket_put_SelectorReadIndex: TCkSocket_put_SelectorReadIndex = nil;
  CkSocket_get_SelectorWriteIndex: TCkSocket_get_SelectorWriteIndex = nil;
  CkSocket_put_SelectorWriteIndex: TCkSocket_put_SelectorWriteIndex = nil;
  CkSocket_get_SendFailReason: TCkSocket_get_SendFailReason = nil;
  CkSocket_get_SendPacketSize: TCkSocket_get_SendPacketSize = nil;
  CkSocket_put_SendPacketSize: TCkSocket_put_SendPacketSize = nil;
  CkSocket_get_SessionLog: TCkSocket_get_SessionLog = nil;
  CkSocket_get_SessionLogEncoding: TCkSocket_get_SessionLogEncoding = nil;
  CkSocket_put_SessionLogEncoding: TCkSocket_put_SessionLogEncoding = nil;
  CkSocket_get_SoRcvBuf: TCkSocket_get_SoRcvBuf = nil;
  CkSocket_put_SoRcvBuf: TCkSocket_put_SoRcvBuf = nil;
  CkSocket_get_SoReuseAddr: TCkSocket_get_SoReuseAddr = nil;
  CkSocket_put_SoReuseAddr: TCkSocket_put_SoReuseAddr = nil;
  CkSocket_get_SoSndBuf: TCkSocket_get_SoSndBuf = nil;
  CkSocket_put_SoSndBuf: TCkSocket_put_SoSndBuf = nil;
  CkSocket_get_SocksHostname: TCkSocket_get_SocksHostname = nil;
  CkSocket_put_SocksHostname: TCkSocket_put_SocksHostname = nil;
  CkSocket_get_SocksPassword: TCkSocket_get_SocksPassword = nil;
  CkSocket_put_SocksPassword: TCkSocket_put_SocksPassword = nil;
  CkSocket_get_SocksPort: TCkSocket_get_SocksPort = nil;
  CkSocket_put_SocksPort: TCkSocket_put_SocksPort = nil;
  CkSocket_get_SocksUsername: TCkSocket_get_SocksUsername = nil;
  CkSocket_put_SocksUsername: TCkSocket_put_SocksUsername = nil;
  CkSocket_get_SocksVersion: TCkSocket_get_SocksVersion = nil;
  CkSocket_put_SocksVersion: TCkSocket_put_SocksVersion = nil;
  CkSocket_get_Ssl: TCkSocket_get_Ssl = nil;
  CkSocket_put_Ssl: TCkSocket_put_Ssl = nil;
  CkSocket_get_SslAllowedCiphers: TCkSocket_get_SslAllowedCiphers = nil;
  CkSocket_put_SslAllowedCiphers: TCkSocket_put_SslAllowedCiphers = nil;
  CkSocket_get_SslProtocol: TCkSocket_get_SslProtocol = nil;
  CkSocket_put_SslProtocol: TCkSocket_put_SslProtocol = nil;
  CkSocket_get_StringCharset: TCkSocket_get_StringCharset = nil;
  CkSocket_put_StringCharset: TCkSocket_put_StringCharset = nil;
  CkSocket_get_TcpNoDelay: TCkSocket_get_TcpNoDelay = nil;
  CkSocket_put_TcpNoDelay: TCkSocket_put_TcpNoDelay = nil;
  CkSocket_get_TlsCipherSuite: TCkSocket_get_TlsCipherSuite = nil;
  CkSocket_get_TlsPinSet: TCkSocket_get_TlsPinSet = nil;
  CkSocket_put_TlsPinSet: TCkSocket_put_TlsPinSet = nil;
  CkSocket_get_TlsVersion: TCkSocket_get_TlsVersion = nil;
  CkSocket_get_UserData: TCkSocket_get_UserData = nil;
  CkSocket_put_UserData: TCkSocket_put_UserData = nil;
  CkSocket_get_ListenPort: TCkSocket_get_ListenPort = nil;
  CkSocket_get_HttpProxyForHttp: TCkSocket_get_HttpProxyForHttp = nil;
  CkSocket_put_HttpProxyForHttp: TCkSocket_put_HttpProxyForHttp = nil;
  CkSocket_get_RcvBytesPerSec: TCkSocket_get_RcvBytesPerSec = nil;
  CkSocket_get_SendBytesPerSec: TCkSocket_get_SendBytesPerSec = nil;
  CkSocket_get_UncommonOptions: TCkSocket_get_UncommonOptions = nil;
  CkSocket_put_UncommonOptions: TCkSocket_put_UncommonOptions = nil;
  CkSocket_get_AlpnProtocol: TCkSocket_get_AlpnProtocol = nil;
  CkSocket_put_AlpnProtocol: TCkSocket_put_AlpnProtocol = nil;
  CkSocket_get_SniHostname: TCkSocket_get_SniHostname = nil;
  CkSocket_put_SniHostname: TCkSocket_put_SniHostname = nil;
  CkSocket_get_NumBytesAvailable: TCkSocket_get_NumBytesAvailable = nil;
  CkSocket_AddSslAcceptableClientCaDn: TCkSocket_AddSslAcceptableClientCaDn = nil;
  CkSocket_BindAndListen: TCkSocket_BindAndListen = nil;
  CkSocket_BuildHttpGetRequest: TCkSocket_BuildHttpGetRequest = nil;
  CkSocket_CheckWriteable: TCkSocket_CheckWriteable = nil;
  CkSocket_ClearSessionLog: TCkSocket_ClearSessionLog = nil;
  CkSocket_Close: TCkSocket_Close = nil;
  CkSocket_Connect: TCkSocket_Connect = nil;
  CkSocket_ConvertFromSsl: TCkSocket_ConvertFromSsl = nil;
  CkSocket_ConvertToSsl: TCkSocket_ConvertToSsl = nil;
  CkSocket_DnsCacheClear: TCkSocket_DnsCacheClear = nil;
  CkSocket_DnsLookup: TCkSocket_DnsLookup = nil;
  CkSocket_GetSslAcceptableClientCaDn: TCkSocket_GetSslAcceptableClientCaDn = nil;
  CkSocket_InitSslServer: TCkSocket_InitSslServer = nil;
  CkSocket_PollDataAvailable: TCkSocket_PollDataAvailable = nil;
  CkSocket_ReceiveByte: TCkSocket_ReceiveByte = nil;
  CkSocket_ReceiveBytesENC: TCkSocket_ReceiveBytesENC = nil;
  CkSocket_ReceiveBytesToFile: TCkSocket_ReceiveBytesToFile = nil;
  CkSocket_ReceiveCount: TCkSocket_ReceiveCount = nil;
  CkSocket_ReceiveInt16: TCkSocket_ReceiveInt16 = nil;
  CkSocket_ReceiveInt32: TCkSocket_ReceiveInt32 = nil;
  CkSocket_ReceiveNBytesENC: TCkSocket_ReceiveNBytesENC = nil;
  CkSocket_ReceiveString: TCkSocket_ReceiveString = nil;
  CkSocket_ReceiveStringMaxN: TCkSocket_ReceiveStringMaxN = nil;
  CkSocket_ReceiveStringUntilByte: TCkSocket_ReceiveStringUntilByte = nil;
  CkSocket_ReceiveToCRLF: TCkSocket_ReceiveToCRLF = nil;
  CkSocket_ReceiveUntilMatch: TCkSocket_ReceiveUntilMatch = nil;
  CkSocket_SelectForReading: TCkSocket_SelectForReading = nil;
  CkSocket_SelectForWriting: TCkSocket_SelectForWriting = nil;
  CkSocket_SendByte: TCkSocket_SendByte = nil;
  CkSocket_SendBytesENC: TCkSocket_SendBytesENC = nil;
  CkSocket_SendCount: TCkSocket_SendCount = nil;
  CkSocket_SendInt16: TCkSocket_SendInt16 = nil;
  CkSocket_SendInt32: TCkSocket_SendInt32 = nil;
  CkSocket_SendString: TCkSocket_SendString = nil;
  CkSocket_SetSslClientCert: TCkSocket_SetSslClientCert = nil;
  CkSocket_SetSslClientCertPem: TCkSocket_SetSslClientCertPem = nil;
  CkSocket_SetSslClientCertPfx: TCkSocket_SetSslClientCertPfx = nil;
  CkSocket_SleepMs: TCkSocket_SleepMs = nil;
  CkSocket_SshAuthenticatePk: TCkSocket_SshAuthenticatePk = nil;
  CkSocket_SshAuthenticatePw: TCkSocket_SshAuthenticatePw = nil;
  CkSocket_SshCloseTunnel: TCkSocket_SshCloseTunnel = nil;
  CkSocket_SshOpenTunnel: TCkSocket_SshOpenTunnel = nil;
  CkSocket_StartTiming: TCkSocket_StartTiming = nil;
  CkSocket_TakeSocket: TCkSocket_TakeSocket = nil;
  CkSocket_TlsRenegotiate: TCkSocket_TlsRenegotiate = nil;
  CkSocket_UseSsh: TCkSocket_UseSsh = nil;
  CkSocket_ReceiveBd: TCkSocket_ReceiveBd = nil;
  CkSocket_ReceiveSb: TCkSocket_ReceiveSb = nil;
  CkSocket_SendBd: TCkSocket_SendBd = nil;
  CkSocket_SendSb: TCkSocket_SendSb = nil;
  CkSocket_ReceiveBdN: TCkSocket_ReceiveBdN = nil;
  CkSocket_SendWakeOnLan: TCkSocket_SendWakeOnLan = nil;
  CkSocket_BindAndListenPortRange: TCkSocket_BindAndListenPortRange = nil;
  CkSocket_ReceiveUntilByteBd: TCkSocket_ReceiveUntilByteBd = nil;
  CkSocket_SendWakeOnLan2: TCkSocket_SendWakeOnLan2 = nil;
  CkSocket_TakeConnection: TCkSocket_TakeConnection = nil;
  CkSocket_ResetPerf: TCkSocket_ResetPerf = nil;
  CkSocket_SendBytes2: TCkSocket_SendBytes2 = nil;
  CkSocket_ReceiveUntilMatchSb: TCkSocket_ReceiveUntilMatchSb = nil;
  CkSocket_GetAdaptersAddresses: TCkSocket_GetAdaptersAddresses = nil;
  CkSocket_GetLastJsonData: TCkSocket_GetLastJsonData = nil;
  CkSocket_GetServerCert: TCkSocket_GetServerCert = nil;
  CkSocket_AcceptNext: TCkSocket_AcceptNext = nil;
  CkSocket_DupSocket: TCkSocket_DupSocket = nil;
  CkSocket_GetMyServerCert: TCkSocket_GetMyServerCert = nil;
  CkSocket_GetRcvdClientCert: TCkSocket_GetRcvdClientCert = nil;
  CkSocket_SshNewChannel: TCkSocket_SshNewChannel = nil;

constructor TSocket.Create;
begin
  inherited Create;
  FHandle := CkSocket_Create();
end;

destructor TSocket.Destroy;
begin
  if FHandle <> nil then
    CkSocket_Dispose(FHandle);
  FHandle := nil;
  inherited;
end;

{ ---- Event callback thunks ---- }
{ Standalone cdecl functions registered with the C bridge.  The bridge
  passes back the userData pointer, which carries the Pascal object
  instance.  A non-zero return value aborts the running method. }

function TSocket_AbortCheckThunk(userData: Pointer): Integer; cdecl;
var
  obj: TSocket;
begin
  Result := 0;
  obj := TSocket(userData);
  if Assigned(obj) and Assigned(obj.FOnAbortCheck) then
    if obj.FOnAbortCheck(obj) then Result := 1;
end;

function TSocket_PercentDoneThunk(pctDone: Integer; userData: Pointer): Integer; cdecl;
var
  obj: TSocket;
begin
  Result := 0;
  obj := TSocket(userData);
  if Assigned(obj) and Assigned(obj.FOnPercentDone) then
    if obj.FOnPercentDone(obj, pctDone) then Result := 1;
end;

procedure TSocket_ProgressInfoThunk(name: PAnsiChar; value: PAnsiChar; userData: Pointer); cdecl;
var
  obj: TSocket;
begin
  obj := TSocket(userData);
  if Assigned(obj) and Assigned(obj.FOnProgressInfo) then
    obj.FOnProgressInfo(obj, CkToStr(name), CkToStr(value));
end;

procedure TSocket.SetOnAbortCheck(AValue: TChilkatAbortCheckEvent);
begin
  FOnAbortCheck := AValue;
  if Assigned(AValue) then
    CkSocket_SetAbortCheckCallback(FHandle, @TSocket_AbortCheckThunk, Self)
  else
    CkSocket_SetAbortCheckCallback(FHandle, nil, nil);
end;

procedure TSocket.SetOnPercentDone(AValue: TChilkatPercentDoneEvent);
begin
  FOnPercentDone := AValue;
  if Assigned(AValue) then
    CkSocket_SetPercentDoneCallback(FHandle, @TSocket_PercentDoneThunk, Self)
  else
    CkSocket_SetPercentDoneCallback(FHandle, nil, nil);
end;

procedure TSocket.SetOnProgressInfo(AValue: TChilkatProgressInfoEvent);
begin
  FOnProgressInfo := AValue;
  if Assigned(AValue) then
    CkSocket_SetProgressInfoCallback(FHandle, @TSocket_ProgressInfoThunk, Self)
  else
    CkSocket_SetProgressInfoCallback(FHandle, nil, nil);
end;

function TSocket.GetLastErrorHtml: string;
begin
  Result := CkToStr(CkSocket_get_LastErrorHtml(FHandle));
end;

function TSocket.GetLastErrorText: string;
begin
  Result := CkToStr(CkSocket_get_LastErrorText(FHandle));
end;

function TSocket.GetLastErrorXml: string;
begin
  Result := CkToStr(CkSocket_get_LastErrorXml(FHandle));
end;

function TSocket.GetVersion: string;
begin
  Result := CkToStr(CkSocket_get_Version(FHandle));
end;

function TSocket.GetDebugLogFilePath: string;
begin
  Result := CkToStr(CkSocket_get_DebugLogFilePath(FHandle));
end;

procedure TSocket.SetDebugLogFilePath(AValue: string);
begin
  CkSocket_put_DebugLogFilePath(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetVerboseLogging: Boolean;
begin
  Result := Boolean(CkSocket_get_VerboseLogging(FHandle));
end;

procedure TSocket.SetVerboseLogging(AValue: Boolean);
begin
  CkSocket_put_VerboseLogging(FHandle, LongBool(AValue));
end;

function TSocket.GetLastMethodSuccess: Boolean;
begin
  Result := Boolean(CkSocket_get_LastMethodSuccess(FHandle));
end;

procedure TSocket.SetLastMethodSuccess(AValue: Boolean);
begin
  CkSocket_put_LastMethodSuccess(FHandle, LongBool(AValue));
end;

function TSocket.GetAbortCurrent: Boolean;
begin
  Result := Boolean(CkSocket_get_AbortCurrent(FHandle));
end;

procedure TSocket.SetAbortCurrent(AValue: Boolean);
begin
  CkSocket_put_AbortCurrent(FHandle, LongBool(AValue));
end;

function TSocket.GetAcceptFailReason: Integer;
begin
  Result := CkSocket_get_AcceptFailReason(FHandle);
end;

function TSocket.GetBandwidthThrottleDown: Integer;
begin
  Result := CkSocket_get_BandwidthThrottleDown(FHandle);
end;

procedure TSocket.SetBandwidthThrottleDown(AValue: Integer);
begin
  CkSocket_put_BandwidthThrottleDown(FHandle, AValue);
end;

function TSocket.GetBandwidthThrottleUp: Integer;
begin
  Result := CkSocket_get_BandwidthThrottleUp(FHandle);
end;

procedure TSocket.SetBandwidthThrottleUp(AValue: Integer);
begin
  CkSocket_put_BandwidthThrottleUp(FHandle, AValue);
end;

function TSocket.GetBigEndian: Boolean;
begin
  Result := Boolean(CkSocket_get_BigEndian(FHandle));
end;

procedure TSocket.SetBigEndian(AValue: Boolean);
begin
  CkSocket_put_BigEndian(FHandle, LongBool(AValue));
end;

function TSocket.GetClientIpAddress: string;
begin
  Result := CkToStr(CkSocket_get_ClientIpAddress(FHandle));
end;

procedure TSocket.SetClientIpAddress(AValue: string);
begin
  CkSocket_put_ClientIpAddress(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetClientPort: Integer;
begin
  Result := CkSocket_get_ClientPort(FHandle);
end;

procedure TSocket.SetClientPort(AValue: Integer);
begin
  CkSocket_put_ClientPort(FHandle, AValue);
end;

function TSocket.GetConnectFailReason: Integer;
begin
  Result := CkSocket_get_ConnectFailReason(FHandle);
end;

function TSocket.GetElapsedSeconds: Integer;
begin
  Result := CkSocket_get_ElapsedSeconds(FHandle);
end;

function TSocket.GetHeartbeatMs: Integer;
begin
  Result := CkSocket_get_HeartbeatMs(FHandle);
end;

procedure TSocket.SetHeartbeatMs(AValue: Integer);
begin
  CkSocket_put_HeartbeatMs(FHandle, AValue);
end;

function TSocket.GetHttpProxyAuthMethod: string;
begin
  Result := CkToStr(CkSocket_get_HttpProxyAuthMethod(FHandle));
end;

procedure TSocket.SetHttpProxyAuthMethod(AValue: string);
begin
  CkSocket_put_HttpProxyAuthMethod(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetHttpProxyDomain: string;
begin
  Result := CkToStr(CkSocket_get_HttpProxyDomain(FHandle));
end;

procedure TSocket.SetHttpProxyDomain(AValue: string);
begin
  CkSocket_put_HttpProxyDomain(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetHttpProxyHostname: string;
begin
  Result := CkToStr(CkSocket_get_HttpProxyHostname(FHandle));
end;

procedure TSocket.SetHttpProxyHostname(AValue: string);
begin
  CkSocket_put_HttpProxyHostname(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetHttpProxyPassword: string;
begin
  Result := CkToStr(CkSocket_get_HttpProxyPassword(FHandle));
end;

procedure TSocket.SetHttpProxyPassword(AValue: string);
begin
  CkSocket_put_HttpProxyPassword(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetHttpProxyPort: Integer;
begin
  Result := CkSocket_get_HttpProxyPort(FHandle);
end;

procedure TSocket.SetHttpProxyPort(AValue: Integer);
begin
  CkSocket_put_HttpProxyPort(FHandle, AValue);
end;

function TSocket.GetHttpProxyUsername: string;
begin
  Result := CkToStr(CkSocket_get_HttpProxyUsername(FHandle));
end;

procedure TSocket.SetHttpProxyUsername(AValue: string);
begin
  CkSocket_put_HttpProxyUsername(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetIsConnected: Boolean;
begin
  Result := Boolean(CkSocket_get_IsConnected(FHandle));
end;

function TSocket.GetKeepAlive: Boolean;
begin
  Result := Boolean(CkSocket_get_KeepAlive(FHandle));
end;

procedure TSocket.SetKeepAlive(AValue: Boolean);
begin
  CkSocket_put_KeepAlive(FHandle, LongBool(AValue));
end;

function TSocket.GetKeepSessionLog: Boolean;
begin
  Result := Boolean(CkSocket_get_KeepSessionLog(FHandle));
end;

procedure TSocket.SetKeepSessionLog(AValue: Boolean);
begin
  CkSocket_put_KeepSessionLog(FHandle, LongBool(AValue));
end;

function TSocket.GetLastMethodFailed: Boolean;
begin
  Result := Boolean(CkSocket_get_LastMethodFailed(FHandle));
end;

function TSocket.GetLocalIpAddress: string;
begin
  Result := CkToStr(CkSocket_get_LocalIpAddress(FHandle));
end;

function TSocket.GetLocalPort: Integer;
begin
  Result := CkSocket_get_LocalPort(FHandle);
end;

function TSocket.GetMaxReadIdleMs: Integer;
begin
  Result := CkSocket_get_MaxReadIdleMs(FHandle);
end;

procedure TSocket.SetMaxReadIdleMs(AValue: Integer);
begin
  CkSocket_put_MaxReadIdleMs(FHandle, AValue);
end;

function TSocket.GetMaxSendIdleMs: Integer;
begin
  Result := CkSocket_get_MaxSendIdleMs(FHandle);
end;

procedure TSocket.SetMaxSendIdleMs(AValue: Integer);
begin
  CkSocket_put_MaxSendIdleMs(FHandle, AValue);
end;

function TSocket.GetMyIpAddress: string;
begin
  Result := CkToStr(CkSocket_get_MyIpAddress(FHandle));
end;

function TSocket.GetNumReceivedClientCerts: Integer;
begin
  Result := CkSocket_get_NumReceivedClientCerts(FHandle);
end;

function TSocket.GetNumSocketsInSet: Integer;
begin
  Result := CkSocket_get_NumSocketsInSet(FHandle);
end;

function TSocket.GetNumSslAcceptableClientCAs: Integer;
begin
  Result := CkSocket_get_NumSslAcceptableClientCAs(FHandle);
end;

function TSocket.GetObjectId: Integer;
begin
  Result := CkSocket_get_ObjectId(FHandle);
end;

function TSocket.GetPercentDoneScale: Integer;
begin
  Result := CkSocket_get_PercentDoneScale(FHandle);
end;

procedure TSocket.SetPercentDoneScale(AValue: Integer);
begin
  CkSocket_put_PercentDoneScale(FHandle, AValue);
end;

function TSocket.GetPreferIpv6: Boolean;
begin
  Result := Boolean(CkSocket_get_PreferIpv6(FHandle));
end;

procedure TSocket.SetPreferIpv6(AValue: Boolean);
begin
  CkSocket_put_PreferIpv6(FHandle, LongBool(AValue));
end;

function TSocket.GetReceiveFailReason: Integer;
begin
  Result := CkSocket_get_ReceiveFailReason(FHandle);
end;

function TSocket.GetReceivePacketSize: Integer;
begin
  Result := CkSocket_get_ReceivePacketSize(FHandle);
end;

procedure TSocket.SetReceivePacketSize(AValue: Integer);
begin
  CkSocket_put_ReceivePacketSize(FHandle, AValue);
end;

function TSocket.GetReceivedCount: Integer;
begin
  Result := CkSocket_get_ReceivedCount(FHandle);
end;

procedure TSocket.SetReceivedCount(AValue: Integer);
begin
  CkSocket_put_ReceivedCount(FHandle, AValue);
end;

function TSocket.GetReceivedInt: Integer;
begin
  Result := CkSocket_get_ReceivedInt(FHandle);
end;

procedure TSocket.SetReceivedInt(AValue: Integer);
begin
  CkSocket_put_ReceivedInt(FHandle, AValue);
end;

function TSocket.GetRemoteIpAddress: string;
begin
  Result := CkToStr(CkSocket_get_RemoteIpAddress(FHandle));
end;

function TSocket.GetRemotePort: Integer;
begin
  Result := CkSocket_get_RemotePort(FHandle);
end;

function TSocket.GetRequireSslCertVerify: Boolean;
begin
  Result := Boolean(CkSocket_get_RequireSslCertVerify(FHandle));
end;

procedure TSocket.SetRequireSslCertVerify(AValue: Boolean);
begin
  CkSocket_put_RequireSslCertVerify(FHandle, LongBool(AValue));
end;

function TSocket.GetSelectorIndex: Integer;
begin
  Result := CkSocket_get_SelectorIndex(FHandle);
end;

procedure TSocket.SetSelectorIndex(AValue: Integer);
begin
  CkSocket_put_SelectorIndex(FHandle, AValue);
end;

function TSocket.GetSelectorReadIndex: Integer;
begin
  Result := CkSocket_get_SelectorReadIndex(FHandle);
end;

procedure TSocket.SetSelectorReadIndex(AValue: Integer);
begin
  CkSocket_put_SelectorReadIndex(FHandle, AValue);
end;

function TSocket.GetSelectorWriteIndex: Integer;
begin
  Result := CkSocket_get_SelectorWriteIndex(FHandle);
end;

procedure TSocket.SetSelectorWriteIndex(AValue: Integer);
begin
  CkSocket_put_SelectorWriteIndex(FHandle, AValue);
end;

function TSocket.GetSendFailReason: Integer;
begin
  Result := CkSocket_get_SendFailReason(FHandle);
end;

function TSocket.GetSendPacketSize: Integer;
begin
  Result := CkSocket_get_SendPacketSize(FHandle);
end;

procedure TSocket.SetSendPacketSize(AValue: Integer);
begin
  CkSocket_put_SendPacketSize(FHandle, AValue);
end;

function TSocket.GetSessionLog: string;
begin
  Result := CkToStr(CkSocket_get_SessionLog(FHandle));
end;

function TSocket.GetSessionLogEncoding: string;
begin
  Result := CkToStr(CkSocket_get_SessionLogEncoding(FHandle));
end;

procedure TSocket.SetSessionLogEncoding(AValue: string);
begin
  CkSocket_put_SessionLogEncoding(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetSoRcvBuf: Integer;
begin
  Result := CkSocket_get_SoRcvBuf(FHandle);
end;

procedure TSocket.SetSoRcvBuf(AValue: Integer);
begin
  CkSocket_put_SoRcvBuf(FHandle, AValue);
end;

function TSocket.GetSoReuseAddr: Boolean;
begin
  Result := Boolean(CkSocket_get_SoReuseAddr(FHandle));
end;

procedure TSocket.SetSoReuseAddr(AValue: Boolean);
begin
  CkSocket_put_SoReuseAddr(FHandle, LongBool(AValue));
end;

function TSocket.GetSoSndBuf: Integer;
begin
  Result := CkSocket_get_SoSndBuf(FHandle);
end;

procedure TSocket.SetSoSndBuf(AValue: Integer);
begin
  CkSocket_put_SoSndBuf(FHandle, AValue);
end;

function TSocket.GetSocksHostname: string;
begin
  Result := CkToStr(CkSocket_get_SocksHostname(FHandle));
end;

procedure TSocket.SetSocksHostname(AValue: string);
begin
  CkSocket_put_SocksHostname(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetSocksPassword: string;
begin
  Result := CkToStr(CkSocket_get_SocksPassword(FHandle));
end;

procedure TSocket.SetSocksPassword(AValue: string);
begin
  CkSocket_put_SocksPassword(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetSocksPort: Integer;
begin
  Result := CkSocket_get_SocksPort(FHandle);
end;

procedure TSocket.SetSocksPort(AValue: Integer);
begin
  CkSocket_put_SocksPort(FHandle, AValue);
end;

function TSocket.GetSocksUsername: string;
begin
  Result := CkToStr(CkSocket_get_SocksUsername(FHandle));
end;

procedure TSocket.SetSocksUsername(AValue: string);
begin
  CkSocket_put_SocksUsername(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetSocksVersion: Integer;
begin
  Result := CkSocket_get_SocksVersion(FHandle);
end;

procedure TSocket.SetSocksVersion(AValue: Integer);
begin
  CkSocket_put_SocksVersion(FHandle, AValue);
end;

function TSocket.GetSsl: Boolean;
begin
  Result := Boolean(CkSocket_get_Ssl(FHandle));
end;

procedure TSocket.SetSsl(AValue: Boolean);
begin
  CkSocket_put_Ssl(FHandle, LongBool(AValue));
end;

function TSocket.GetSslAllowedCiphers: string;
begin
  Result := CkToStr(CkSocket_get_SslAllowedCiphers(FHandle));
end;

procedure TSocket.SetSslAllowedCiphers(AValue: string);
begin
  CkSocket_put_SslAllowedCiphers(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetSslProtocol: string;
begin
  Result := CkToStr(CkSocket_get_SslProtocol(FHandle));
end;

procedure TSocket.SetSslProtocol(AValue: string);
begin
  CkSocket_put_SslProtocol(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetStringCharset: string;
begin
  Result := CkToStr(CkSocket_get_StringCharset(FHandle));
end;

procedure TSocket.SetStringCharset(AValue: string);
begin
  CkSocket_put_StringCharset(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetTcpNoDelay: Boolean;
begin
  Result := Boolean(CkSocket_get_TcpNoDelay(FHandle));
end;

procedure TSocket.SetTcpNoDelay(AValue: Boolean);
begin
  CkSocket_put_TcpNoDelay(FHandle, LongBool(AValue));
end;

function TSocket.GetTlsCipherSuite: string;
begin
  Result := CkToStr(CkSocket_get_TlsCipherSuite(FHandle));
end;

function TSocket.GetTlsPinSet: string;
begin
  Result := CkToStr(CkSocket_get_TlsPinSet(FHandle));
end;

procedure TSocket.SetTlsPinSet(AValue: string);
begin
  CkSocket_put_TlsPinSet(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetTlsVersion: string;
begin
  Result := CkToStr(CkSocket_get_TlsVersion(FHandle));
end;

function TSocket.GetUserData: string;
begin
  Result := CkToStr(CkSocket_get_UserData(FHandle));
end;

procedure TSocket.SetUserData(AValue: string);
begin
  CkSocket_put_UserData(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetListenPort: Integer;
begin
  Result := CkSocket_get_ListenPort(FHandle);
end;

function TSocket.GetHttpProxyForHttp: Boolean;
begin
  Result := Boolean(CkSocket_get_HttpProxyForHttp(FHandle));
end;

procedure TSocket.SetHttpProxyForHttp(AValue: Boolean);
begin
  CkSocket_put_HttpProxyForHttp(FHandle, LongBool(AValue));
end;

function TSocket.GetRcvBytesPerSec: Integer;
begin
  Result := CkSocket_get_RcvBytesPerSec(FHandle);
end;

function TSocket.GetSendBytesPerSec: Integer;
begin
  Result := CkSocket_get_SendBytesPerSec(FHandle);
end;

function TSocket.GetUncommonOptions: string;
begin
  Result := CkToStr(CkSocket_get_UncommonOptions(FHandle));
end;

procedure TSocket.SetUncommonOptions(AValue: string);
begin
  CkSocket_put_UncommonOptions(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetAlpnProtocol: string;
begin
  Result := CkToStr(CkSocket_get_AlpnProtocol(FHandle));
end;

procedure TSocket.SetAlpnProtocol(AValue: string);
begin
  CkSocket_put_AlpnProtocol(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetSniHostname: string;
begin
  Result := CkToStr(CkSocket_get_SniHostname(FHandle));
end;

procedure TSocket.SetSniHostname(AValue: string);
begin
  CkSocket_put_SniHostname(FHandle, PAnsiChar(StrToCk(AValue)));
end;

function TSocket.GetNumBytesAvailable: Integer;
begin
  Result := CkSocket_get_NumBytesAvailable(FHandle);
end;

function TSocket.AddSslAcceptableClientCaDn(const certAuthDN: string): Boolean;
begin
  Result := Boolean(CkSocket_AddSslAcceptableClientCaDn(FHandle, PAnsiChar(StrToCk(certAuthDN))));
end;

function TSocket.BindAndListen(port: Integer; backLog: Integer): Boolean;
begin
  Result := Boolean(CkSocket_BindAndListen(FHandle, port, backLog));
end;

function TSocket.BuildHttpGetRequest(const url: string): string;
begin
  Result := CkToStr(CkSocket_BuildHttpGetRequest(FHandle, PAnsiChar(StrToCk(url))));
end;

function TSocket.CheckWriteable(maxWaitMs: Integer): Integer;
begin
  Result := CkSocket_CheckWriteable(FHandle, maxWaitMs);
end;

procedure TSocket.ClearSessionLog;
begin
  CkSocket_ClearSessionLog(FHandle);
end;

function TSocket.Close(maxWaitMs: Integer): Boolean;
begin
  Result := Boolean(CkSocket_Close(FHandle, maxWaitMs));
end;

function TSocket.Connect(const hostname: string; port: Integer; ssl: Boolean; maxWaitMs: Integer): Boolean;
begin
  Result := Boolean(CkSocket_Connect(FHandle, PAnsiChar(StrToCk(hostname)), port, LongBool(ssl), maxWaitMs));
end;

function TSocket.ConvertFromSsl: Boolean;
begin
  Result := Boolean(CkSocket_ConvertFromSsl(FHandle));
end;

function TSocket.ConvertToSsl: Boolean;
begin
  Result := Boolean(CkSocket_ConvertToSsl(FHandle));
end;

procedure TSocket.DnsCacheClear;
begin
  CkSocket_DnsCacheClear(FHandle);
end;

function TSocket.DnsLookup(const hostname: string; maxWaitMs: Integer): string;
begin
  Result := CkToStr(CkSocket_DnsLookup(FHandle, PAnsiChar(StrToCk(hostname)), maxWaitMs));
end;

function TSocket.GetSslAcceptableClientCaDn(index: Integer): string;
begin
  Result := CkToStr(CkSocket_GetSslAcceptableClientCaDn(FHandle, index));
end;

function TSocket.InitSslServer(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_InitSslServer(FHandle, cert.Handle));
end;

function TSocket.PollDataAvailable: Boolean;
begin
  Result := Boolean(CkSocket_PollDataAvailable(FHandle));
end;

function TSocket.ReceiveByte(bUnsigned: Boolean): Boolean;
begin
  Result := Boolean(CkSocket_ReceiveByte(FHandle, LongBool(bUnsigned)));
end;

function TSocket.ReceiveBytesENC(const encodingAlg: string): string;
begin
  Result := CkToStr(CkSocket_ReceiveBytesENC(FHandle, PAnsiChar(StrToCk(encodingAlg))));
end;

function TSocket.ReceiveBytesToFile(const appendFilename: string): Boolean;
begin
  Result := Boolean(CkSocket_ReceiveBytesToFile(FHandle, PAnsiChar(StrToCk(appendFilename))));
end;

function TSocket.ReceiveCount: Integer;
begin
  Result := CkSocket_ReceiveCount(FHandle);
end;

function TSocket.ReceiveInt16(bigEndian: Boolean; bUnsigned: Boolean): Boolean;
begin
  Result := Boolean(CkSocket_ReceiveInt16(FHandle, LongBool(bigEndian), LongBool(bUnsigned)));
end;

function TSocket.ReceiveInt32(bigEndian: Boolean): Boolean;
begin
  Result := Boolean(CkSocket_ReceiveInt32(FHandle, LongBool(bigEndian)));
end;

function TSocket.ReceiveNBytesENC(numBytes: LongWord; const encodingAlg: string): string;
begin
  Result := CkToStr(CkSocket_ReceiveNBytesENC(FHandle, numBytes, PAnsiChar(StrToCk(encodingAlg))));
end;

function TSocket.ReceiveString: string;
begin
  Result := CkToStr(CkSocket_ReceiveString(FHandle));
end;

function TSocket.ReceiveStringMaxN(maxByteCount: Integer): string;
begin
  Result := CkToStr(CkSocket_ReceiveStringMaxN(FHandle, maxByteCount));
end;

function TSocket.ReceiveStringUntilByte(lookForByte: Integer): string;
begin
  Result := CkToStr(CkSocket_ReceiveStringUntilByte(FHandle, lookForByte));
end;

function TSocket.ReceiveToCRLF: string;
begin
  Result := CkToStr(CkSocket_ReceiveToCRLF(FHandle));
end;

function TSocket.ReceiveUntilMatch(const matchStr: string): string;
begin
  Result := CkToStr(CkSocket_ReceiveUntilMatch(FHandle, PAnsiChar(StrToCk(matchStr))));
end;

function TSocket.SelectForReading(timeoutMs: Integer): Integer;
begin
  Result := CkSocket_SelectForReading(FHandle, timeoutMs);
end;

function TSocket.SelectForWriting(timeoutMs: Integer): Integer;
begin
  Result := CkSocket_SelectForWriting(FHandle, timeoutMs);
end;

function TSocket.SendByte(value: Integer): Boolean;
begin
  Result := Boolean(CkSocket_SendByte(FHandle, value));
end;

function TSocket.SendBytesENC(const encodedBytes: string; const encodingAlg: string): Boolean;
begin
  Result := Boolean(CkSocket_SendBytesENC(FHandle, PAnsiChar(StrToCk(encodedBytes)), PAnsiChar(StrToCk(encodingAlg))));
end;

function TSocket.SendCount(byteCount: Integer): Boolean;
begin
  Result := Boolean(CkSocket_SendCount(FHandle, byteCount));
end;

function TSocket.SendInt16(value: Integer; bigEndian: Boolean): Boolean;
begin
  Result := Boolean(CkSocket_SendInt16(FHandle, value, LongBool(bigEndian)));
end;

function TSocket.SendInt32(value: Integer; bigEndian: Boolean): Boolean;
begin
  Result := Boolean(CkSocket_SendInt32(FHandle, value, LongBool(bigEndian)));
end;

function TSocket.SendString(const stringToSend: string): Boolean;
begin
  Result := Boolean(CkSocket_SendString(FHandle, PAnsiChar(StrToCk(stringToSend))));
end;

function TSocket.SetSslClientCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_SetSslClientCert(FHandle, cert.Handle));
end;

function TSocket.SetSslClientCertPem(const pemDataOrFilename: string; const pemPassword: string): Boolean;
begin
  Result := Boolean(CkSocket_SetSslClientCertPem(FHandle, PAnsiChar(StrToCk(pemDataOrFilename)), PAnsiChar(StrToCk(pemPassword))));
end;

function TSocket.SetSslClientCertPfx(const pfxFilename: string; const pfxPassword: string): Boolean;
begin
  Result := Boolean(CkSocket_SetSslClientCertPfx(FHandle, PAnsiChar(StrToCk(pfxFilename)), PAnsiChar(StrToCk(pfxPassword))));
end;

procedure TSocket.SleepMs(millisec: Integer);
begin
  CkSocket_SleepMs(FHandle, millisec);
end;

function TSocket.SshAuthenticatePk(const sshLogin: string; privateKey: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_SshAuthenticatePk(FHandle, PAnsiChar(StrToCk(sshLogin)), privateKey.Handle));
end;

function TSocket.SshAuthenticatePw(const sshLogin: string; const sshPassword: string): Boolean;
begin
  Result := Boolean(CkSocket_SshAuthenticatePw(FHandle, PAnsiChar(StrToCk(sshLogin)), PAnsiChar(StrToCk(sshPassword))));
end;

function TSocket.SshCloseTunnel: Boolean;
begin
  Result := Boolean(CkSocket_SshCloseTunnel(FHandle));
end;

function TSocket.SshOpenTunnel(const sshHostname: string; sshPort: Integer): Boolean;
begin
  Result := Boolean(CkSocket_SshOpenTunnel(FHandle, PAnsiChar(StrToCk(sshHostname)), sshPort));
end;

procedure TSocket.StartTiming;
begin
  CkSocket_StartTiming(FHandle);
end;

function TSocket.TakeSocket(sock: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_TakeSocket(FHandle, sock.Handle));
end;

function TSocket.TlsRenegotiate: Boolean;
begin
  Result := Boolean(CkSocket_TlsRenegotiate(FHandle));
end;

function TSocket.UseSsh(ssh: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_UseSsh(FHandle, ssh.Handle));
end;

function TSocket.ReceiveBd(binData: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_ReceiveBd(FHandle, binData.Handle));
end;

function TSocket.ReceiveSb(sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_ReceiveSb(FHandle, sb.Handle));
end;

function TSocket.SendBd(binData: TChilkatBase; offset: LongWord; numBytes: LongWord): Boolean;
begin
  Result := Boolean(CkSocket_SendBd(FHandle, binData.Handle, offset, numBytes));
end;

function TSocket.SendSb(sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_SendSb(FHandle, sb.Handle));
end;

function TSocket.ReceiveBdN(numBytes: LongWord; binData: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_ReceiveBdN(FHandle, numBytes, binData.Handle));
end;

function TSocket.SendWakeOnLan(const macAddress: string; port: Integer; const ipBroadcastAddr: string): Boolean;
begin
  Result := Boolean(CkSocket_SendWakeOnLan(FHandle, PAnsiChar(StrToCk(macAddress)), port, PAnsiChar(StrToCk(ipBroadcastAddr))));
end;

function TSocket.BindAndListenPortRange(beginPort: Integer; endPort: Integer; backLog: Integer): Integer;
begin
  Result := CkSocket_BindAndListenPortRange(FHandle, beginPort, endPort, backLog);
end;

function TSocket.ReceiveUntilByteBd(lookForByte: Integer; bd: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_ReceiveUntilByteBd(FHandle, lookForByte, bd.Handle));
end;

function TSocket.SendWakeOnLan2(const macAddress: string; port: Integer; const ipBroadcastAddr: string; const password: string): Boolean;
begin
  Result := Boolean(CkSocket_SendWakeOnLan2(FHandle, PAnsiChar(StrToCk(macAddress)), port, PAnsiChar(StrToCk(ipBroadcastAddr)), PAnsiChar(StrToCk(password))));
end;

function TSocket.TakeConnection(sock: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_TakeConnection(FHandle, sock.Handle));
end;

procedure TSocket.ResetPerf(rcvPerf: Boolean);
begin
  CkSocket_ResetPerf(FHandle, LongBool(rcvPerf));
end;

function TSocket.SendBytes2(pByteData: Pointer; szByteData: LongWord): Boolean;
begin
  Result := Boolean(CkSocket_SendBytes2(FHandle, pByteData, szByteData));
end;

function TSocket.ReceiveUntilMatchSb(const matchStr: string; sb: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_ReceiveUntilMatchSb(FHandle, PAnsiChar(StrToCk(matchStr)), sb.Handle));
end;

function TSocket.GetAdaptersAddresses(json: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_GetAdaptersAddresses(FHandle, json.Handle));
end;

procedure TSocket.GetLastJsonData(json: TChilkatBase);
begin
  CkSocket_GetLastJsonData(FHandle, json.Handle);
end;

function TSocket.GetServerCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_GetServerCert(FHandle, cert.Handle));
end;

function TSocket.AcceptNext(maxWaitMs: Integer; socket: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_AcceptNext(FHandle, maxWaitMs, socket.Handle));
end;

function TSocket.DupSocket(dest: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_DupSocket(FHandle, dest.Handle));
end;

function TSocket.GetMyServerCert(cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_GetMyServerCert(FHandle, cert.Handle));
end;

function TSocket.GetRcvdClientCert(index: Integer; cert: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_GetRcvdClientCert(FHandle, index, cert.Handle));
end;

function TSocket.SshNewChannel(const hostname: string; port: Integer; ssl: Boolean; maxWaitMs: Integer; channel: TChilkatBase): Boolean;
begin
  Result := Boolean(CkSocket_SshNewChannel(FHandle, PAnsiChar(StrToCk(hostname)), port, LongBool(ssl), maxWaitMs, channel.Handle));
end;

initialization
  Chilkat_GetProcedureAddress(CkSocket_Create,  'CkSocket_Create');
  Chilkat_GetProcedureAddress(CkSocket_Dispose, 'CkSocket_Dispose');
  Chilkat_GetProcedureAddress(CkSocket_SetAbortCheckCallback, 'CkSocket_SetAbortCheckCallback');
  Chilkat_GetProcedureAddress(CkSocket_SetPercentDoneCallback, 'CkSocket_SetPercentDoneCallback');
  Chilkat_GetProcedureAddress(CkSocket_SetProgressInfoCallback, 'CkSocket_SetProgressInfoCallback');
  Chilkat_GetProcedureAddress(CkSocket_get_LastErrorHtml, 'CkSocket_get_LastErrorHtml');
  Chilkat_GetProcedureAddress(CkSocket_get_LastErrorText, 'CkSocket_get_LastErrorText');
  Chilkat_GetProcedureAddress(CkSocket_get_LastErrorXml, 'CkSocket_get_LastErrorXml');
  Chilkat_GetProcedureAddress(CkSocket_get_Version, 'CkSocket_get_Version');
  Chilkat_GetProcedureAddress(CkSocket_get_DebugLogFilePath, 'CkSocket_get_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkSocket_put_DebugLogFilePath, 'CkSocket_put_DebugLogFilePath');
  Chilkat_GetProcedureAddress(CkSocket_get_VerboseLogging, 'CkSocket_get_VerboseLogging');
  Chilkat_GetProcedureAddress(CkSocket_put_VerboseLogging, 'CkSocket_put_VerboseLogging');
  Chilkat_GetProcedureAddress(CkSocket_get_LastMethodSuccess, 'CkSocket_get_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkSocket_put_LastMethodSuccess, 'CkSocket_put_LastMethodSuccess');
  Chilkat_GetProcedureAddress(CkSocket_get_AbortCurrent, 'CkSocket_get_AbortCurrent');
  Chilkat_GetProcedureAddress(CkSocket_put_AbortCurrent, 'CkSocket_put_AbortCurrent');
  Chilkat_GetProcedureAddress(CkSocket_get_AcceptFailReason, 'CkSocket_get_AcceptFailReason');
  Chilkat_GetProcedureAddress(CkSocket_get_BandwidthThrottleDown, 'CkSocket_get_BandwidthThrottleDown');
  Chilkat_GetProcedureAddress(CkSocket_put_BandwidthThrottleDown, 'CkSocket_put_BandwidthThrottleDown');
  Chilkat_GetProcedureAddress(CkSocket_get_BandwidthThrottleUp, 'CkSocket_get_BandwidthThrottleUp');
  Chilkat_GetProcedureAddress(CkSocket_put_BandwidthThrottleUp, 'CkSocket_put_BandwidthThrottleUp');
  Chilkat_GetProcedureAddress(CkSocket_get_BigEndian, 'CkSocket_get_BigEndian');
  Chilkat_GetProcedureAddress(CkSocket_put_BigEndian, 'CkSocket_put_BigEndian');
  Chilkat_GetProcedureAddress(CkSocket_get_ClientIpAddress, 'CkSocket_get_ClientIpAddress');
  Chilkat_GetProcedureAddress(CkSocket_put_ClientIpAddress, 'CkSocket_put_ClientIpAddress');
  Chilkat_GetProcedureAddress(CkSocket_get_ClientPort, 'CkSocket_get_ClientPort');
  Chilkat_GetProcedureAddress(CkSocket_put_ClientPort, 'CkSocket_put_ClientPort');
  Chilkat_GetProcedureAddress(CkSocket_get_ConnectFailReason, 'CkSocket_get_ConnectFailReason');
  Chilkat_GetProcedureAddress(CkSocket_get_ElapsedSeconds, 'CkSocket_get_ElapsedSeconds');
  Chilkat_GetProcedureAddress(CkSocket_get_HeartbeatMs, 'CkSocket_get_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkSocket_put_HeartbeatMs, 'CkSocket_put_HeartbeatMs');
  Chilkat_GetProcedureAddress(CkSocket_get_HttpProxyAuthMethod, 'CkSocket_get_HttpProxyAuthMethod');
  Chilkat_GetProcedureAddress(CkSocket_put_HttpProxyAuthMethod, 'CkSocket_put_HttpProxyAuthMethod');
  Chilkat_GetProcedureAddress(CkSocket_get_HttpProxyDomain, 'CkSocket_get_HttpProxyDomain');
  Chilkat_GetProcedureAddress(CkSocket_put_HttpProxyDomain, 'CkSocket_put_HttpProxyDomain');
  Chilkat_GetProcedureAddress(CkSocket_get_HttpProxyHostname, 'CkSocket_get_HttpProxyHostname');
  Chilkat_GetProcedureAddress(CkSocket_put_HttpProxyHostname, 'CkSocket_put_HttpProxyHostname');
  Chilkat_GetProcedureAddress(CkSocket_get_HttpProxyPassword, 'CkSocket_get_HttpProxyPassword');
  Chilkat_GetProcedureAddress(CkSocket_put_HttpProxyPassword, 'CkSocket_put_HttpProxyPassword');
  Chilkat_GetProcedureAddress(CkSocket_get_HttpProxyPort, 'CkSocket_get_HttpProxyPort');
  Chilkat_GetProcedureAddress(CkSocket_put_HttpProxyPort, 'CkSocket_put_HttpProxyPort');
  Chilkat_GetProcedureAddress(CkSocket_get_HttpProxyUsername, 'CkSocket_get_HttpProxyUsername');
  Chilkat_GetProcedureAddress(CkSocket_put_HttpProxyUsername, 'CkSocket_put_HttpProxyUsername');
  Chilkat_GetProcedureAddress(CkSocket_get_IsConnected, 'CkSocket_get_IsConnected');
  Chilkat_GetProcedureAddress(CkSocket_get_KeepAlive, 'CkSocket_get_KeepAlive');
  Chilkat_GetProcedureAddress(CkSocket_put_KeepAlive, 'CkSocket_put_KeepAlive');
  Chilkat_GetProcedureAddress(CkSocket_get_KeepSessionLog, 'CkSocket_get_KeepSessionLog');
  Chilkat_GetProcedureAddress(CkSocket_put_KeepSessionLog, 'CkSocket_put_KeepSessionLog');
  Chilkat_GetProcedureAddress(CkSocket_get_LastMethodFailed, 'CkSocket_get_LastMethodFailed');
  Chilkat_GetProcedureAddress(CkSocket_get_LocalIpAddress, 'CkSocket_get_LocalIpAddress');
  Chilkat_GetProcedureAddress(CkSocket_get_LocalPort, 'CkSocket_get_LocalPort');
  Chilkat_GetProcedureAddress(CkSocket_get_MaxReadIdleMs, 'CkSocket_get_MaxReadIdleMs');
  Chilkat_GetProcedureAddress(CkSocket_put_MaxReadIdleMs, 'CkSocket_put_MaxReadIdleMs');
  Chilkat_GetProcedureAddress(CkSocket_get_MaxSendIdleMs, 'CkSocket_get_MaxSendIdleMs');
  Chilkat_GetProcedureAddress(CkSocket_put_MaxSendIdleMs, 'CkSocket_put_MaxSendIdleMs');
  Chilkat_GetProcedureAddress(CkSocket_get_MyIpAddress, 'CkSocket_get_MyIpAddress');
  Chilkat_GetProcedureAddress(CkSocket_get_NumReceivedClientCerts, 'CkSocket_get_NumReceivedClientCerts');
  Chilkat_GetProcedureAddress(CkSocket_get_NumSocketsInSet, 'CkSocket_get_NumSocketsInSet');
  Chilkat_GetProcedureAddress(CkSocket_get_NumSslAcceptableClientCAs, 'CkSocket_get_NumSslAcceptableClientCAs');
  Chilkat_GetProcedureAddress(CkSocket_get_ObjectId, 'CkSocket_get_ObjectId');
  Chilkat_GetProcedureAddress(CkSocket_get_PercentDoneScale, 'CkSocket_get_PercentDoneScale');
  Chilkat_GetProcedureAddress(CkSocket_put_PercentDoneScale, 'CkSocket_put_PercentDoneScale');
  Chilkat_GetProcedureAddress(CkSocket_get_PreferIpv6, 'CkSocket_get_PreferIpv6');
  Chilkat_GetProcedureAddress(CkSocket_put_PreferIpv6, 'CkSocket_put_PreferIpv6');
  Chilkat_GetProcedureAddress(CkSocket_get_ReceiveFailReason, 'CkSocket_get_ReceiveFailReason');
  Chilkat_GetProcedureAddress(CkSocket_get_ReceivePacketSize, 'CkSocket_get_ReceivePacketSize');
  Chilkat_GetProcedureAddress(CkSocket_put_ReceivePacketSize, 'CkSocket_put_ReceivePacketSize');
  Chilkat_GetProcedureAddress(CkSocket_get_ReceivedCount, 'CkSocket_get_ReceivedCount');
  Chilkat_GetProcedureAddress(CkSocket_put_ReceivedCount, 'CkSocket_put_ReceivedCount');
  Chilkat_GetProcedureAddress(CkSocket_get_ReceivedInt, 'CkSocket_get_ReceivedInt');
  Chilkat_GetProcedureAddress(CkSocket_put_ReceivedInt, 'CkSocket_put_ReceivedInt');
  Chilkat_GetProcedureAddress(CkSocket_get_RemoteIpAddress, 'CkSocket_get_RemoteIpAddress');
  Chilkat_GetProcedureAddress(CkSocket_get_RemotePort, 'CkSocket_get_RemotePort');
  Chilkat_GetProcedureAddress(CkSocket_get_RequireSslCertVerify, 'CkSocket_get_RequireSslCertVerify');
  Chilkat_GetProcedureAddress(CkSocket_put_RequireSslCertVerify, 'CkSocket_put_RequireSslCertVerify');
  Chilkat_GetProcedureAddress(CkSocket_get_SelectorIndex, 'CkSocket_get_SelectorIndex');
  Chilkat_GetProcedureAddress(CkSocket_put_SelectorIndex, 'CkSocket_put_SelectorIndex');
  Chilkat_GetProcedureAddress(CkSocket_get_SelectorReadIndex, 'CkSocket_get_SelectorReadIndex');
  Chilkat_GetProcedureAddress(CkSocket_put_SelectorReadIndex, 'CkSocket_put_SelectorReadIndex');
  Chilkat_GetProcedureAddress(CkSocket_get_SelectorWriteIndex, 'CkSocket_get_SelectorWriteIndex');
  Chilkat_GetProcedureAddress(CkSocket_put_SelectorWriteIndex, 'CkSocket_put_SelectorWriteIndex');
  Chilkat_GetProcedureAddress(CkSocket_get_SendFailReason, 'CkSocket_get_SendFailReason');
  Chilkat_GetProcedureAddress(CkSocket_get_SendPacketSize, 'CkSocket_get_SendPacketSize');
  Chilkat_GetProcedureAddress(CkSocket_put_SendPacketSize, 'CkSocket_put_SendPacketSize');
  Chilkat_GetProcedureAddress(CkSocket_get_SessionLog, 'CkSocket_get_SessionLog');
  Chilkat_GetProcedureAddress(CkSocket_get_SessionLogEncoding, 'CkSocket_get_SessionLogEncoding');
  Chilkat_GetProcedureAddress(CkSocket_put_SessionLogEncoding, 'CkSocket_put_SessionLogEncoding');
  Chilkat_GetProcedureAddress(CkSocket_get_SoRcvBuf, 'CkSocket_get_SoRcvBuf');
  Chilkat_GetProcedureAddress(CkSocket_put_SoRcvBuf, 'CkSocket_put_SoRcvBuf');
  Chilkat_GetProcedureAddress(CkSocket_get_SoReuseAddr, 'CkSocket_get_SoReuseAddr');
  Chilkat_GetProcedureAddress(CkSocket_put_SoReuseAddr, 'CkSocket_put_SoReuseAddr');
  Chilkat_GetProcedureAddress(CkSocket_get_SoSndBuf, 'CkSocket_get_SoSndBuf');
  Chilkat_GetProcedureAddress(CkSocket_put_SoSndBuf, 'CkSocket_put_SoSndBuf');
  Chilkat_GetProcedureAddress(CkSocket_get_SocksHostname, 'CkSocket_get_SocksHostname');
  Chilkat_GetProcedureAddress(CkSocket_put_SocksHostname, 'CkSocket_put_SocksHostname');
  Chilkat_GetProcedureAddress(CkSocket_get_SocksPassword, 'CkSocket_get_SocksPassword');
  Chilkat_GetProcedureAddress(CkSocket_put_SocksPassword, 'CkSocket_put_SocksPassword');
  Chilkat_GetProcedureAddress(CkSocket_get_SocksPort, 'CkSocket_get_SocksPort');
  Chilkat_GetProcedureAddress(CkSocket_put_SocksPort, 'CkSocket_put_SocksPort');
  Chilkat_GetProcedureAddress(CkSocket_get_SocksUsername, 'CkSocket_get_SocksUsername');
  Chilkat_GetProcedureAddress(CkSocket_put_SocksUsername, 'CkSocket_put_SocksUsername');
  Chilkat_GetProcedureAddress(CkSocket_get_SocksVersion, 'CkSocket_get_SocksVersion');
  Chilkat_GetProcedureAddress(CkSocket_put_SocksVersion, 'CkSocket_put_SocksVersion');
  Chilkat_GetProcedureAddress(CkSocket_get_Ssl, 'CkSocket_get_Ssl');
  Chilkat_GetProcedureAddress(CkSocket_put_Ssl, 'CkSocket_put_Ssl');
  Chilkat_GetProcedureAddress(CkSocket_get_SslAllowedCiphers, 'CkSocket_get_SslAllowedCiphers');
  Chilkat_GetProcedureAddress(CkSocket_put_SslAllowedCiphers, 'CkSocket_put_SslAllowedCiphers');
  Chilkat_GetProcedureAddress(CkSocket_get_SslProtocol, 'CkSocket_get_SslProtocol');
  Chilkat_GetProcedureAddress(CkSocket_put_SslProtocol, 'CkSocket_put_SslProtocol');
  Chilkat_GetProcedureAddress(CkSocket_get_StringCharset, 'CkSocket_get_StringCharset');
  Chilkat_GetProcedureAddress(CkSocket_put_StringCharset, 'CkSocket_put_StringCharset');
  Chilkat_GetProcedureAddress(CkSocket_get_TcpNoDelay, 'CkSocket_get_TcpNoDelay');
  Chilkat_GetProcedureAddress(CkSocket_put_TcpNoDelay, 'CkSocket_put_TcpNoDelay');
  Chilkat_GetProcedureAddress(CkSocket_get_TlsCipherSuite, 'CkSocket_get_TlsCipherSuite');
  Chilkat_GetProcedureAddress(CkSocket_get_TlsPinSet, 'CkSocket_get_TlsPinSet');
  Chilkat_GetProcedureAddress(CkSocket_put_TlsPinSet, 'CkSocket_put_TlsPinSet');
  Chilkat_GetProcedureAddress(CkSocket_get_TlsVersion, 'CkSocket_get_TlsVersion');
  Chilkat_GetProcedureAddress(CkSocket_get_UserData, 'CkSocket_get_UserData');
  Chilkat_GetProcedureAddress(CkSocket_put_UserData, 'CkSocket_put_UserData');
  Chilkat_GetProcedureAddress(CkSocket_get_ListenPort, 'CkSocket_get_ListenPort');
  Chilkat_GetProcedureAddress(CkSocket_get_HttpProxyForHttp, 'CkSocket_get_HttpProxyForHttp');
  Chilkat_GetProcedureAddress(CkSocket_put_HttpProxyForHttp, 'CkSocket_put_HttpProxyForHttp');
  Chilkat_GetProcedureAddress(CkSocket_get_RcvBytesPerSec, 'CkSocket_get_RcvBytesPerSec');
  Chilkat_GetProcedureAddress(CkSocket_get_SendBytesPerSec, 'CkSocket_get_SendBytesPerSec');
  Chilkat_GetProcedureAddress(CkSocket_get_UncommonOptions, 'CkSocket_get_UncommonOptions');
  Chilkat_GetProcedureAddress(CkSocket_put_UncommonOptions, 'CkSocket_put_UncommonOptions');
  Chilkat_GetProcedureAddress(CkSocket_get_AlpnProtocol, 'CkSocket_get_AlpnProtocol');
  Chilkat_GetProcedureAddress(CkSocket_put_AlpnProtocol, 'CkSocket_put_AlpnProtocol');
  Chilkat_GetProcedureAddress(CkSocket_get_SniHostname, 'CkSocket_get_SniHostname');
  Chilkat_GetProcedureAddress(CkSocket_put_SniHostname, 'CkSocket_put_SniHostname');
  Chilkat_GetProcedureAddress(CkSocket_get_NumBytesAvailable, 'CkSocket_get_NumBytesAvailable');
  Chilkat_GetProcedureAddress(CkSocket_AddSslAcceptableClientCaDn, 'CkSocket_AddSslAcceptableClientCaDn');
  Chilkat_GetProcedureAddress(CkSocket_BindAndListen, 'CkSocket_BindAndListen');
  Chilkat_GetProcedureAddress(CkSocket_BuildHttpGetRequest, 'CkSocket_BuildHttpGetRequest');
  Chilkat_GetProcedureAddress(CkSocket_CheckWriteable, 'CkSocket_CheckWriteable');
  Chilkat_GetProcedureAddress(CkSocket_ClearSessionLog, 'CkSocket_ClearSessionLog');
  Chilkat_GetProcedureAddress(CkSocket_Close, 'CkSocket_Close');
  Chilkat_GetProcedureAddress(CkSocket_Connect, 'CkSocket_Connect');
  Chilkat_GetProcedureAddress(CkSocket_ConvertFromSsl, 'CkSocket_ConvertFromSsl');
  Chilkat_GetProcedureAddress(CkSocket_ConvertToSsl, 'CkSocket_ConvertToSsl');
  Chilkat_GetProcedureAddress(CkSocket_DnsCacheClear, 'CkSocket_DnsCacheClear');
  Chilkat_GetProcedureAddress(CkSocket_DnsLookup, 'CkSocket_DnsLookup');
  Chilkat_GetProcedureAddress(CkSocket_GetSslAcceptableClientCaDn, 'CkSocket_GetSslAcceptableClientCaDn');
  Chilkat_GetProcedureAddress(CkSocket_InitSslServer, 'CkSocket_InitSslServer');
  Chilkat_GetProcedureAddress(CkSocket_PollDataAvailable, 'CkSocket_PollDataAvailable');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveByte, 'CkSocket_ReceiveByte');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveBytesENC, 'CkSocket_ReceiveBytesENC');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveBytesToFile, 'CkSocket_ReceiveBytesToFile');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveCount, 'CkSocket_ReceiveCount');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveInt16, 'CkSocket_ReceiveInt16');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveInt32, 'CkSocket_ReceiveInt32');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveNBytesENC, 'CkSocket_ReceiveNBytesENC');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveString, 'CkSocket_ReceiveString');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveStringMaxN, 'CkSocket_ReceiveStringMaxN');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveStringUntilByte, 'CkSocket_ReceiveStringUntilByte');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveToCRLF, 'CkSocket_ReceiveToCRLF');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveUntilMatch, 'CkSocket_ReceiveUntilMatch');
  Chilkat_GetProcedureAddress(CkSocket_SelectForReading, 'CkSocket_SelectForReading');
  Chilkat_GetProcedureAddress(CkSocket_SelectForWriting, 'CkSocket_SelectForWriting');
  Chilkat_GetProcedureAddress(CkSocket_SendByte, 'CkSocket_SendByte');
  Chilkat_GetProcedureAddress(CkSocket_SendBytesENC, 'CkSocket_SendBytesENC');
  Chilkat_GetProcedureAddress(CkSocket_SendCount, 'CkSocket_SendCount');
  Chilkat_GetProcedureAddress(CkSocket_SendInt16, 'CkSocket_SendInt16');
  Chilkat_GetProcedureAddress(CkSocket_SendInt32, 'CkSocket_SendInt32');
  Chilkat_GetProcedureAddress(CkSocket_SendString, 'CkSocket_SendString');
  Chilkat_GetProcedureAddress(CkSocket_SetSslClientCert, 'CkSocket_SetSslClientCert');
  Chilkat_GetProcedureAddress(CkSocket_SetSslClientCertPem, 'CkSocket_SetSslClientCertPem');
  Chilkat_GetProcedureAddress(CkSocket_SetSslClientCertPfx, 'CkSocket_SetSslClientCertPfx');
  Chilkat_GetProcedureAddress(CkSocket_SleepMs, 'CkSocket_SleepMs');
  Chilkat_GetProcedureAddress(CkSocket_SshAuthenticatePk, 'CkSocket_SshAuthenticatePk');
  Chilkat_GetProcedureAddress(CkSocket_SshAuthenticatePw, 'CkSocket_SshAuthenticatePw');
  Chilkat_GetProcedureAddress(CkSocket_SshCloseTunnel, 'CkSocket_SshCloseTunnel');
  Chilkat_GetProcedureAddress(CkSocket_SshOpenTunnel, 'CkSocket_SshOpenTunnel');
  Chilkat_GetProcedureAddress(CkSocket_StartTiming, 'CkSocket_StartTiming');
  Chilkat_GetProcedureAddress(CkSocket_TakeSocket, 'CkSocket_TakeSocket');
  Chilkat_GetProcedureAddress(CkSocket_TlsRenegotiate, 'CkSocket_TlsRenegotiate');
  Chilkat_GetProcedureAddress(CkSocket_UseSsh, 'CkSocket_UseSsh');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveBd, 'CkSocket_ReceiveBd');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveSb, 'CkSocket_ReceiveSb');
  Chilkat_GetProcedureAddress(CkSocket_SendBd, 'CkSocket_SendBd');
  Chilkat_GetProcedureAddress(CkSocket_SendSb, 'CkSocket_SendSb');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveBdN, 'CkSocket_ReceiveBdN');
  Chilkat_GetProcedureAddress(CkSocket_SendWakeOnLan, 'CkSocket_SendWakeOnLan');
  Chilkat_GetProcedureAddress(CkSocket_BindAndListenPortRange, 'CkSocket_BindAndListenPortRange');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveUntilByteBd, 'CkSocket_ReceiveUntilByteBd');
  Chilkat_GetProcedureAddress(CkSocket_SendWakeOnLan2, 'CkSocket_SendWakeOnLan2');
  Chilkat_GetProcedureAddress(CkSocket_TakeConnection, 'CkSocket_TakeConnection');
  Chilkat_GetProcedureAddress(CkSocket_ResetPerf, 'CkSocket_ResetPerf');
  Chilkat_GetProcedureAddress(CkSocket_SendBytes2, 'CkSocket_SendBytes2');
  Chilkat_GetProcedureAddress(CkSocket_ReceiveUntilMatchSb, 'CkSocket_ReceiveUntilMatchSb');
  Chilkat_GetProcedureAddress(CkSocket_GetAdaptersAddresses, 'CkSocket_GetAdaptersAddresses');
  Chilkat_GetProcedureAddress(CkSocket_GetLastJsonData, 'CkSocket_GetLastJsonData');
  Chilkat_GetProcedureAddress(CkSocket_GetServerCert, 'CkSocket_GetServerCert');
  Chilkat_GetProcedureAddress(CkSocket_AcceptNext, 'CkSocket_AcceptNext');
  Chilkat_GetProcedureAddress(CkSocket_DupSocket, 'CkSocket_DupSocket');
  Chilkat_GetProcedureAddress(CkSocket_GetMyServerCert, 'CkSocket_GetMyServerCert');
  Chilkat_GetProcedureAddress(CkSocket_GetRcvdClientCert, 'CkSocket_GetRcvdClientCert');
  Chilkat_GetProcedureAddress(CkSocket_SshNewChannel, 'CkSocket_SshNewChannel');

end.
