public enum ClientCloseReason extends Enum<ClientCloseReason>
Enum Constant and Description |
---|
ABORTED
The client connection was aborted by the server, possibly because the
connection was disallowed.
|
CLIENT_UNRESPONSIVE
The client had become unresponsive.
|
CLOSED_BY_CLIENT
The client requested close.
|
CLOSED_BY_PUBLISHER
Closed by Publisher API.
|
CONNECTION_LOST
The connection to the client was lost - possibly dropped by the client.
|
FAILED_OVER
The client has failed over to a different server.
|
INTERNAL_ERROR
An internal error occurred.
|
INVALID_INBOUND_MESSAGE
An inbound message with an invalid format was received.
|
IO_EXCEPTION
An unexpected IO Exception occurred.
|
LOST_MESSAGES
Loss of messages from the client has been detected.
|
MESSAGE_QUEUE_LIMIT_REACHED
The maximum outbound queue size was reached for the client.
|
MESSAGE_TOO_LARGE
The client sent a message that exceeded the maximum message size.
|
SERVER_CLOSING
The Diffusion server is closing down.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isMessageQueueLimitReached()
Is the reason
MESSAGE_QUEUE_LIMIT_REACHED . |
boolean |
isRecoverable()
Is the state recoverable - i.e.
|
static ClientCloseReason |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ClientCloseReason[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ClientCloseReason CONNECTION_LOST
A client may be closed for may reasons that are presented as CONNECTION_LOST.
During connection the connection can be lost. The server might have received a connection or reconnection request from a client already connected. The server might have received a reconnection request without a client ID. The connection may not have been authorised because the credentials are wrong. The maximum number of clients might already be connected.
Once connected the connection can be lost for different reasons. If the client closes its connection while the server is writing a message to the client. With the chunked encoding based connection the HTTP response is completed by the server. If the client does not open a new request within a timeout the client will be closed. If a poll request times out and the server finds that the connection has already been closed by the client.
public static final ClientCloseReason IO_EXCEPTION
While trying to perform an I/O operation an exception was generated. This often means that Diffusion attempted to read from a closed TCP connection.
This can also happen to HTTP Comet streaming clients if there is a malformed chunk length header before a chunk of messages.
This may happen if a message that is larger than the input buffer of the connector is received. The message cannot be read by Diffusion so the client is closed.
When Diffusion is handling SSL connections if there is a problem encrypting or decrypting a message the client will be closed for this reason.
public static final ClientCloseReason CLIENT_UNRESPONSIVE
The client has either failed to respond to a ping message in a timely manner or the client has failed to open an HTTP poll for messages. The client does not appear to be receiving messages.
public static final ClientCloseReason MESSAGE_QUEUE_LIMIT_REACHED
Messages sent to the client are placed in a queue. This queue has a maximum allowed size. If the queue limit is reached the client is closed and the queue discarded. The queue is intended to protect against slow patches, reaching the queue limit is taken to mean that the client cannot keep up with the number of messages sent to it.
public static final ClientCloseReason CLOSED_BY_CLIENT
public static final ClientCloseReason MESSAGE_TOO_LARGE
The server has a maximum message size. If a client sends a message larger than this the server is unable to process it. When this happens the message is discarded and the client is closed.
public static final ClientCloseReason INTERNAL_ERROR
public static final ClientCloseReason INVALID_INBOUND_MESSAGE
A message received by the server is not a valid Diffusion message. The server is unable to process this and closes the client that sent it.
public static final ClientCloseReason ABORTED
This is may be because the connection was disallowed. Abort messages are also sent to clients that have unrecognised client IDs. This may be because the server closed the client previously but the client is unaware of this and tried to continue interacting with the server.
public static final ClientCloseReason LOST_MESSAGES
HTTP based transports use multiple TCP connections. This can cause the messages to be received out of order. To reorder the messages those sent to the server may contain a sequence number indicating the correct order.
If a message is received out of order there is a short time for the earlier messages to be received. If the messages are not received in this time the client is closed.
Missing, invalid or duplicate sequence numbers will also close the client for this reason.
This cannot be recovered from as the client and the server are in inconsistent states.
public static final ClientCloseReason SERVER_CLOSING
The client was closed as part of the Diffusion shutdown process.
public static final ClientCloseReason CLOSED_BY_PUBLISHER
A publisher initiated the client close.
public static final ClientCloseReason FAILED_OVER
The session is still open but is now connected to a different Diffusion server. This server has evicted its view of the client from its set of local clients.
public static ClientCloseReason[] values()
for (ClientCloseReason c : ClientCloseReason.values()) System.out.println(c);
public static ClientCloseReason valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isMessageQueueLimitReached()
MESSAGE_QUEUE_LIMIT_REACHED
.
MESSAGE_QUEUE_LIMIT_REACHED
.public boolean isRecoverable()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.