51 |
|
FFirebirdAPI: IFirebirdAPI; |
52 |
|
FProtocol: TProtocol; |
53 |
|
FServerName: AnsiString; |
54 |
+ |
FPort: AnsiString; |
55 |
|
procedure CheckServerName; |
56 |
|
protected |
57 |
|
FSPB: ISPB; |
58 |
|
procedure InternalAttach(ConnectString: AnsiString); virtual; abstract; |
59 |
|
public |
60 |
< |
constructor Create(ServerName: AnsiString; Protocol: TProtocol; SPB: ISPB); |
60 |
> |
constructor Create(ServerName: AnsiString; Protocol: TProtocol; SPB: ISPB; Port: AnsiString = ''); |
61 |
|
destructor Destroy; override; |
62 |
|
public |
63 |
|
{IServiceManager} |
73 |
|
|
74 |
|
implementation |
75 |
|
|
76 |
< |
uses FBMessages, FBClientAPI; |
76 |
> |
uses FBMessages, FBClientAPI, IBUtils; |
77 |
|
|
78 |
|
{ TFBServiceManager } |
79 |
|
|
83 |
|
IBError(ibxeServerNameMissing, [nil]); |
84 |
|
end; |
85 |
|
|
86 |
< |
constructor TFBServiceManager.Create(ServerName: AnsiString; Protocol: TProtocol; |
87 |
< |
SPB: ISPB); |
86 |
> |
constructor TFBServiceManager.Create(ServerName: AnsiString; |
87 |
> |
Protocol: TProtocol; SPB: ISPB; Port: AnsiString); |
88 |
|
begin |
89 |
|
inherited Create; |
90 |
|
FFirebirdAPI := FirebirdAPI; {Keep reference to interface} |
91 |
|
FProtocol := Protocol; |
92 |
|
FSPB := SPB; |
93 |
|
FServerName := ServerName; |
94 |
+ |
FPort := Port; |
95 |
|
Attach; |
96 |
|
end; |
97 |
|
|
114 |
|
procedure TFBServiceManager.Attach; |
115 |
|
var ConnectString: AnsiString; |
116 |
|
begin |
117 |
< |
case FProtocol of |
116 |
< |
TCP: ConnectString := FServerName + ':service_mgr'; {do not localize} |
117 |
< |
SPX: ConnectString := FServerName + '@service_mgr'; {do not localize} |
118 |
< |
NamedPipe: ConnectString := '\\' + FServerName + '\service_mgr'; {do not localize} |
119 |
< |
Local: ConnectString := 'service_mgr'; {do not localize} |
120 |
< |
end; |
117 |
> |
ConnectString := MakeConnectString(FServerName,'service_mgr',FProtocol,FPort); |
118 |
|
InternalAttach(ConnectString); |
119 |
|
end; |
120 |
|
|