Table of Contents

Class MassiveStreamEvictedException

Namespace
MassiveDotNet.WebSocket
Assembly
MassiveDotNet.WebSocket.dll

The server closed this connection to make room for another one on the same key.

public sealed class MassiveStreamEvictedException : MassiveStreamException, ISerializable
Inheritance
MassiveStreamEvictedException
Implements
Inherited Members

Remarks

Massive answers a connection it is about to evict with a max_connections status and then closes it, so eviction is the one documented disconnect cause that announces itself. The SDK keeps that announcement and reports it here instead of the bare drop, which carries no close code and reads exactly like a slow consumer or a network failure (D42).

The drop itself travels as InnerException: it is still what physically ended the read, and substituting the cause is not a reason to discard the evidence.

Unlike MassiveStreamAuthenticationException this is not terminal by itself. The reconnect policy is unchanged, so a stream configured to reconnect will reconnect -- and two clients sharing a one-connection plan will keep displacing each other. The SDK reports; what to do about it is the consumer's decision, and it needs this to make it. A consumer whose stream reconnects never sees this exception at all, because the connection does not end: there, the eviction is readable as EvictionCount and LastEvictionMessage.

Constructors

MassiveStreamEvictedException(string, Exception)

Creates the exception.

public MassiveStreamEvictedException(string serverMessage, Exception innerException)

Parameters

serverMessage string

The message the server sent, verbatim.

innerException Exception

The drop that ended the connection.

Properties

ServerMessage

The server's own message, unmodified.

public string ServerMessage { get; }

Property Value

string

Remarks

Reported rather than categorised, for the reason D35 gives for auth_failed and D37 gives for a refused subscribe: the SDK cannot improve on the server's own words without inventing a category that drifts the moment the service rewords one. A handler that wants to act on the eviction acts on the exception's type, which is what makes this status different from error -- the status value itself names the cause.