unit mConnectEncrypt;

interface

uses ClientService, Controls;


function Open(AUser: Integer): Boolean;

function ReadDogData(const AAddr, ABytes: Integer; P: Pointer): Boolean;

procedure CloseConnection;

implementation

var
  FClient: TScClient;

function Open(AUser: Integer): Boolean;
begin
  FClient.UserType := AUser;

  if FClient.ConnectServer then Result := True
  else Result := False;
end;

function ReadDogData(const AAddr, ABytes: Integer; P: Pointer): Boolean;
begin
  Result := FClient.CheckConnection(AAddr, ABytes, P);
end;

procedure CloseConnection;
begin
  FClient.CloseConnection;
end;

initialization
  FClient := TScClient.Create;

finalization
  FClient.Free;

end.
