The TRPCBroker component you've added to your form is hard coded to access the Broker server and listener port that it picks up from your own (developer) workstation (by default, BROKERSERVER and 9200). Naturally you don't want this to be the only server and port that your application can connect to. To retrieve the end-user workstation's designated Broker server and port to connect to, as stored in their Registry, you can use the GetServerInfo function.
To retrieve the end-user workstation's designated server and port:
procedure TForm1.FormCreate(Sender: TObject);
var ServerStr: String;
PortStr: String;
begin
// get the correct port and server from Registry
if GetServerInfo(ServerStr,PortStr)<> mrCancel then
begin
RPCBroker1.Server:=ServerStr;
RPCBroker1.ListenerPort:=StrToInt(PortStr);
end {connectOK}
else
Application.Terminate;
end;
Now that you have code to retrieve the appropriate RPC Broker server and listener port, in the next section of the tutorial your application will use the TRPCBroker component to establish a connection to the server.