@zeroc/ice
    Preparing search index...

    Interface Connection

    The user-level interface to a connection.

    interface Connection {
        abort(): void;
        close(): Promise<void>;
        createProxy(id: Identity): ObjectPrx;
        disableInactivityCheck(): void;
        flushBatchRequests(): Promise<void>;
        getAdapter(): ObjectAdapter;
        getEndpoint(): Endpoint;
        getInfo(): Ice.ConnectionInfo;
        setAdapter(adapter: ObjectAdapter): void;
        setCloseCallback(callback: CloseCallback): void;
        throwException(): void;
        toString(): string;
        type(): string;
    }
    Index

    Methods

    • Manually aborts the connection.

      Returns void

    • Manually closes the connection gracefully after waiting for all pending invocations to complete.

      Returns Promise<void>

      A promise that resolves when the close operation is complete.

    • Creates a special proxy that always uses this connection. This is useful for callbacks from a server to a client when the server cannot directly establish a connection to the client, such as in cases where firewalls are present. In such scenarios, the server would create a proxy using an already established connection from the client.

      Parameters

      • id: Identity

        The identity for which the proxy is to be created.

      Returns ObjectPrx

      A proxy that matches the given identity and uses this connection.

    • Disables the inactivity check on this connection.

      Returns void

    • Flush any pending batch requests for this connection. This means all batch requests invoked on fixed proxies associated with the connection.

      Returns Promise<void>

      The asynchronous result object for the invocation.

    • Get the endpoint from which the connection was created.

      Returns Endpoint

      The endpoint from which the connection was created.

    • Associates an object adapter with this connection. When a connection receives a request, it dispatches this request using its associated object adapter. If the associated object adapter is null, the connection rejects any incoming request with an ObjectNotExistException. The default object adapter of an outgoing connection is the communicator's default object adapter.

      Parameters

      • adapter: ObjectAdapter

        The object adapter to associate with this connection.

      Returns void

    • Sets a close callback on the connection. The callback is invoked by the connection when it is closed. If the callback needs more information about the closure, it can call Connection#throwException.

      Parameters

      Returns void

    • Throw an exception indicating the reason for connection closure. For example, CloseConnectionException is raised if the connection was closed gracefully, whereas ConnectionAbortedException/ConnectionClosedException is raised if the connection was manually closed by the application. This operation does nothing if the connection is not yet closed.

      Returns void

    • Return a description of the connection as human readable text, suitable for logging or error messages.

      Returns string

      The description of the connection as human readable text.

    • Returns the connection type, which corresponds to the endpoint type (e.g., "tcp", "udp", etc.).

      Returns string

      The type of the connection.