closeOnOversizedFrame property

bool closeOnOversizedFrame
final

Whether an oversized inbound frame kills the connection. Defaults to !isClient.

The two sides of a connection want opposite answers:

  • A SERVER (true). dart:io buffers a whole WebSocket message before delivering it, so the peak is resident before this class sees a byte and cannot be avoided. Closing is then the only lever left — a connection that survives lets one peer repeat that peak at will.
  • A CLIENT (false). The peer is the server it chose, and killing the connection over one large response takes every other in-flight call with it. gRPC's answer is RESOURCE_EXHAUSTED on that RPC, which is what this produces.

Implementation

final bool closeOnOversizedFrame;