getClientIp method

String? getClientIp()

Inquiry method that gets the IP address of this client as seen by the Server which is serving the current session as the client remote address.

Note that it may not correspond to the client host.For instance, it may refer to an intermediate proxy.

If, upon a new session, this address changes, it may be a hint that the intermediary network nodes handling the connection have changed, hence the network capabilities may be different. The library uses this information to optimize the connection.

Note that in case of polling or in case rebind requests are needed, subsequent requests related to the same session may, in principle, expose a different IP address to the Server; these changes would not be reported.

Lifecycle If a session is not currently active, null is returned; soon after a session is established, the value may become available.

Notification A change to this setting will be notified through a call to ClientListener.onPropertyChange with argument "clientIp" on any ClientListener listening to the related LightstreamerClient.

Returns A canonical representation of an IP address (it can be either IPv4 or IPv6), or null.

Implementation

String? getClientIp() {
  return _clientIp;
}