RPC HELP TRPCBroker Socket Example

Socket Example

The following program code populates the Socket property with the active port on the VistA M Server:

function ExistingSocket(Broker: TRPCBroker): integer; var Index: integer; begin Result := 0; if Assigned(BrokerConnections) and BrokerConnections.Find(Broker.Server + ':' + IntToStr(Broker.ListenerPort), Index) then Result := TRPCBroker(BrokerConnections.Objects[Index]).Socket; end;