* Publish and observe port

git-svn-id: trunk@35419 -
This commit is contained in:
michael 2017-02-11 09:45:13 +00:00
parent f5b76b62fe
commit faa70adcd3

View File

@ -131,6 +131,7 @@ type
property LoginPrompt; property LoginPrompt;
property Params; property Params;
property OnLogin; property OnLogin;
Property Port;
end; end;
{ TIBConnectionDef } { TIBConnectionDef }
@ -611,6 +612,8 @@ procedure TIBConnection.ConnectFB;
var var
ADatabaseName: String; ADatabaseName: String;
DPB: string; DPB: string;
HN : String;
begin begin
DPB := chr(isc_dpb_version1); DPB := chr(isc_dpb_version1);
if (UserName <> '') then if (UserName <> '') then
@ -625,8 +628,15 @@ begin
DPB := DPB + Chr(isc_dpb_lc_ctype) + Chr(Length(CharSet)) + CharSet; DPB := DPB + Chr(isc_dpb_lc_ctype) + Chr(Length(CharSet)) + CharSet;
FDatabaseHandle := nil; FDatabaseHandle := nil;
if HostName <> '' then ADatabaseName := HostName+':'+DatabaseName HN:=HostName;
else ADatabaseName := DatabaseName; if HN <> '' then
begin
if Port<>0 then
HN:=HN+'/'+IntToStr(Port);
ADatabaseName := HN+':'+DatabaseName
end
else
ADatabaseName := DatabaseName;
if isc_attach_database(@FStatus[0], Length(ADatabaseName), @ADatabaseName[1], if isc_attach_database(@FStatus[0], Length(ADatabaseName), @ADatabaseName[1],
@FDatabaseHandle, Length(DPB), @DPB[1]) <> 0 then @FDatabaseHandle, Length(DPB), @DPB[1]) <> 0 then
CheckError('DoInternalConnect', FStatus); CheckError('DoInternalConnect', FStatus);