setContentLength method

void setContentLength(
  1. int newVal
)

Setter method that sets the length in bytes to be used by the Server for the response body on a stream connection (a minimum length, however, is ensured by the server).

After the content length exhaustion, the connection will be closed and a new bind connection will be automatically reopened.
NOTE that this setting only applies to the "HTTP-STREAMING" case (i.e. not to WebSockets).

Default A length decided by the library, to ensure the best performance. It can be of a few MB or much higher, depending on the environment.

Lifecycle The content length should be set before calling the LightstreamerClient.connect method. However, the value can be changed at any time: the supplied value will be used for the next streaming connection (either a bind or a brand new session).

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

  • newVal The length to be used by the Server for the response body on a HTTP stream connection.

Throws IllegalArgumentException if a negative or zero value is configured

Implementation

void setContentLength(int newVal) {
  _contentLength = newVal;
}