Previous: , Up: OCapN: The Object Capabilities Network   [Contents][Index]


7.6 Handling Disconnects

For remote references, it can be useful to know when the connection to be the remote peer has broken (intentionally or otherwise). In Goblins, this is known as a sever event. Severence can be detected using on-sever which is provided by the (goblins) module.

Procedure: on-sever remote-refr handler

Register handler to be called when connection to remote-refr is severed.

The remote-refr should be a reference to an object on a remote peer, if the connection between the remote peer that the object is located on, the handler is informed. The handler is either a procedure or Goblins object. handler is called with two arguments: the severance type (a symbol) and the reason (a string).

on-sever returns to the caller a Goblins object which when invoked cancels the interest in severence.

NOTE: If severance has already occured when calling on-sever, the handler will be informed immediately.