Objects#
This page covers the objects a client holds for the instances of a server’s classes. An object is encoded as its id, as described under Protocol Buffers Encoding.
Equality#
objects-equality [core] [MUST]Two objects with the same id are equal. Objects with different ids are not, and an object is not equal to null.
objects-hash [core] [MUST]Equal objects hash equal, in a language that hashes values.
objects-sorting [ordering] [MUST]Objects order by their ids, compared as unsigned integers. An object orders equal to itself and to another object with its id. Each of the language’s comparison operators agrees with this order.
Object Ids#
objects-get-object-id [core] [MUST]The client’s object id helper returns the id of an object, and raises the argument error for null.
objects-object-id-range [core] [MUST]An object holds any
uint64id, including 0, which the server never issues.
objects-unknown-object-id [core] [MUST]The client sends the id of an object as it is, without checking it. An id the server never issued, including 0, raises the error for
KRPC.ArgumentException, as the target of a call or as an argument.
Connections#
objects-method-connection [connections] [MUST]A method calls over the connection that returned its object, whichever connection runs the call.
objects-static-method-connection [connections] [MUST]A static method calls over the connection it is called on. Where classes are values, that is the connection of the service the class is reached through. Elsewhere it is the connection passed as the method’s first argument.
objects-bound-static-method-connection [connections, bound-classes] [MUST]A static method called through its class bound to a connection calls over that connection.
objects-static-method-through-an-object-connection [connections] [MUST]In a language that calls a static method on an object, a static method called through an object calls over the connection that returned the object.
objects-object-from-another-connection [connections] [MUST]An object passes to a call on another connection to the same server: as an argument of a procedure, a method or a static method, as the value of a property, and inside a collection or a structure. The call gets the object with its id.
objects-equality-across-connections [connections] [MUST]Objects with the same id are equal, whichever connections returned them.
objects-hash-across-connections [connections] [MUST]Objects with the same id hash equal, whichever connections returned them, in a language that hashes values.
Closed Connections#
objects-call-after-close [core] [MUST]A call through an object after its connection is closed raises the connection error.