Table of Contents

OIL2 Class Standard.PeerRegistry


class Standard . PeerRegistry {
        set     clients;
        oid     registeredAsOID;
inherits from Object;

DESCRIPTION

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.

METHODS


Standard.PeerRegistry:create

PeerRegistry:create()

Method Description

The create method takes no arguments.


Standard.PeerRegistry:listPeers

PeerRegistry:listPeers()

Method Description

Returns an array of connected peers.


Standard.PeerRegistry:lookupLocalService

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.


Standard.PeerRegistry:newPeer

PeerRegistry:newPeer(oid rmtObjCreator, oid viaPeer)

Method Description

Notes the existence of a new peer.


Standard.PeerRegistry:lostPeer

PeerRegistry:lostPeer(oid rmtObjCreator)

Method Description

Notes the lost of connectivity to a peer.


Standard.PeerRegistry:addNotifyWhenPeerRegistered

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.


Standard.PeerRegistry:removeNotifyWhenPeerRegistered

PeerRegistry:removeNotifyWhenPeerRegistered(oid client)

Method Description

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

Return Value

Zero is always returned.