class Standard . PeerRegistry {
set clients;
oid registeredAsOID;
} inherits from Object;
Tracking of connected peers is performed by a PeerRegistry object. Only one object of this type should be created per address space. A PeerRegistry object registers itself as the named local service PeerRegistry. Many interprocess applications require the services provided by a PeerRegistry object, thus it is strongly recommended that one by created before any AcceptPeerConnections or ConnectToPeer objects are created. This is a passive object and creates no timers or sockets, thus it will not interfere with the operation of other applications.
PeerRegistry:create()
The create method takes no arguments.
PeerRegistry:listPeers()
Returns an array of connected peers.
PeerRegistry:lookupLocalService(string serviceName)
Looks up on the local system the service identified by the name serviceName and returns the registered object Id or else nil if no such service is registered.
PeerRegistry:newPeer(oid rmtObjCreator, oid viaPeer)
Notes the existence of a new peer.
PeerRegistry:lostPeer(oid rmtObjCreator)
Notes the lost of connectivity to a peer.
PeerRegistry:addNotifyWhenPeerRegistered(oid client, optional int32 dumpCurrentList)
Permits event-driven applications to be notified when a new PeerConnection is successfully established. The client will be sent a peerRegistered message and passed the object Id of the remote ObjectCreator object. When connectivity to the peer is lost, a corresponding peerUnregistered message will also be sent. The dumpCurrentList parameter is optional. If equal to 1, the current list of known peers will be sent by a series of peerRegistered messages. After the entire current table is sent, a peerRegistered message with an argument of nil will be sent.
PeerRegistry:removeNotifyWhenPeerRegistered(oid client)
Removes a subscription that was previously established by a addNotifyWhenPeerRegistered request.