Table of Contents

OIL2 Class Standard.PeerRegistry

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.




Method Description

The create method takes no arguments.



Method Description

Returns an array of connected peers.


PeerRegistry:lookupLocalService(string serviceName)

Method Description

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)

Method Description

Notes the existence of a new peer.


PeerRegistry:lostPeer(oid rmtObjCreator)

Method Description

Notes the lost of connectivity to a peer.


PeerRegistry:addNotifyWhenPeerRegistered(oid client, optional int32 dumpCurrentList)

Method Description

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.

Return Value

Zero is always returned.


PeerRegistry:removeNotifyWhenPeerRegistered(oid client)

Method Description

Removes a subscription that was previously established by a addNotifyWhenPeerRegistered request.

Return Value

Zero is always returned.