The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Libwebsockets::X::WebSocketClose - Non-success WebSocket close

SYNOPSIS

    if ($err->get('code') == 4000) {
        # .. whatever special handling your application may define
        # for close code 4000 ..
    }
    else {
        die $err;
    }

DESCRIPTION

This class represents a WebSocket close whose code is not a recognized success state: 1000, or empty.

Note that high-range close codes (e.g., 4xxx) also trigger this, so if your application is going to be sending those, be sure to catch this error and handle it accordingly.

ATTRIBUTES

  • code

  • reason (decoded text!)