ws_close (ws v0.1.1)

View Source

Close-code classification and validation (RFC 6455 §7.4).

1000..1003, 1007..1011 are defined. 1004 is reserved; 1005, 1006, 1015 MUST NOT appear on the wire. 3000..3999 are reserved for registration. 4000..4999 are free for application use.

Summary

Functions

Human-readable label for a standard close code. Returns undefined for application-range codes the library does not know about.

True if Code is allowed to appear in a close frame on the wire.

Types

code/0

-type code() :: 1000..4999.

Functions

reason_name(_)

-spec reason_name(integer()) -> atom().

Human-readable label for a standard close code. Returns undefined for application-range codes the library does not know about.

valid_on_wire(Code)

-spec valid_on_wire(integer()) -> boolean().

True if Code is allowed to appear in a close frame on the wire.