---
title: "How Glacier2 Uses Request Contexts"
url: https://docs.zeroc.com/ice/3.8/services/glacier2/how-glacier2-uses-request-contexts
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# How Glacier2 Uses Request Contexts

The Glacier2 router examines the [context](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts.md) of an incoming request for special keys that affect how the router forwards the request. These keys have the same semantics for requests from clients to servers and for callbacks from servers to clients.

## The `_fwd` Context

The `_fwd` context determines the proxy mode that the router uses when forwarding the request. The value associated with the `_fwd` key must be a string containing one or more of the characters shown in the following table:

| **Value** | **Mode** |
| --- | --- |
| d or D | Datagram (requests from clients to servers only) |
| o or O | Oneway |
| t | Twoway |
| z | Compress |

*Legal values for the `_fwd` context key*.

These characters match the corresponding [stringified proxy options](https://docs.zeroc.com/ice/3.8/runtime/invocation/syntax-for-stringified-proxies.md), except the Glacier2 router does not support batched invocations.

If the `_fwd` key is not present in a request context, the mode used by the router to forward that request depends on the request ID:

- If the sender sent the request as twoway (request ID > 0), the router also uses twoway mode.
- If the sender sent the request as a oneway or batch oneway (request ID == 0), the router forwards the request as a oneway request.

## Context Forwarding

The configuration properties [Glacier2.Client.ForwardContext](https://docs.zeroc.com/ice/3.8/property-reference/glacier2-properties.md#glacier2.client.forwardcontext) and [Glacier2.Server.ForwardContext](https://docs.zeroc.com/ice/3.8/property-reference/glacier2-properties.md#glacier2.server.forwardcontext) determine whether the router includes the context when forwarding a request. The former property affects requests from clients to servers, while the latter affects requests from servers to clients. If a property is not defined or is set to `0`, the router does not include the context when forwarding requests.

When [Glacier2.AddConnectionContext](https://docs.zeroc.com/ice/3.8/property-reference/glacier2-properties.md#glacier2.addconnectioncontext) is `1`, the router includes connection information when forwarding requests from clients to servers, even if `Glacier2.Client.ForwardContext` is `0`.

## See Also

- [Request Contexts](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts.md)
- [Invocation Mode](https://docs.zeroc.com/ice/3.8/runtime/invocation/invocation-mode.md)
- [Syntax for Stringified Proxies](https://docs.zeroc.com/ice/3.8/runtime/invocation/syntax-for-stringified-proxies.md)
- [Glacier2.\*](https://docs.zeroc.com/ice/3.8/property-reference/glacier2-properties.md)
