RPC HELP TXWBWinsock

From VistApedia
Jump to: navigation, search

TXWBWinsock Class

Description

The methods in the wsockc.pas unit were originally library methods or methods not associated with a class. To ensure that the TCCOWRPCBroker component is thread-safe (i.e., thread safe operation of Broker instances created in different threads), it became necessary for each instance of the TRPCBroker to have its own instance of these methods, values, etc. Thus, the TXWBWinsock class was created to encapsulate the following Public members:

  • XNetCallPending: boolean
  • xFlush: boolean;
  • SocketError: integer;
  • XHookTimeOut: integer;
  • XNetTimerStart: TDateTime;
  • BROKERSERVER: string;
  • SecuritySegment: string;
  • ApplicationSegment: string;
  • IsConnected: Boolean;
  • property CountWidth: Integer
  • property IsBackwardsCompatible: Boolean
  • function NetCall(hSocket: integer; imsg: string): PChar;
  • function tCall(hSocket: integer; api, apVer: String; Parameters: TParams; var Sec, App: PChar; TimeOut: integer): PChar;
  • function cRight( z: PChar; n: longint): PChar;
  • function cLeft( z: PChar; n: longint): PChar;
  • function BuildApi( n,p: string; f: longint): string;
  • function BuildHdr( wkid: string; winh: string; prch: string; wish: string): string;
  • function BuildPar(hSocket: integer; api, RPCVer: string; const Parameters: TParams): string;
  • function StrPack( n: string; p: integer): string;
  • function VarPack(n: string): string;
  • function NetStart(ForegroundM: boolean; Server: string; ListnerPort: integer; var hSocket: integer): integer;
  • function NetworkConnect(ForegroundM: boolean; Server: string; ListnerPort, TimeOut: integer): integer;
  • function libSynGetHostIP(s: string): string;
  • function libNetCreate(lpWSData : TWSAData) : integer;
  • function libNetDestroy: integer;
  • function GetServerPacket(hSocket: integer): string;
  • procedure NetworkDisconnect(hSocket: integer);
  • procedure NetStop(hSocket: integer);
  • procedure CloseSockSystem(hSocket: integer; s: string);
  • procedure NetError(Action: string; ErrType: integer);
  • function NetStart1(ForegroundM: boolean; Server: string; ListnerPort: integer; var hSocket: integer): Integer; virtual;
  • function BuildPar1(hSocket: integer; api, RPCVer: string; const Parameters: TParams): String; virtual;
  • constructor Create;

The following remain library or non-class methods:

  • function LPack(Str: String; NDigits: Integer): String;
  • function SPack(Str: String): String;
  • function NetBlockingHook: BOOL; export;