# Method SSL.sslfile()->set_alert_callback()

Method set_alert_callback

  `void set_alert_callback(function(object, int|object, string:void) alert)`

Description

  Install a function that will be called when an alert packet is about to be sent. It doesn't affect the callback mode - it's called both from backends and from within normal function calls like read and write.

  This callback can be used to implement fallback to other protocols when used on the server side together with shutdown().

Note

  This object is part of a cyclic reference whenever this is set, just like setting any other callback.

Note

  This callback is not cleared by set_blocking, or settable by set_callbacks or set_nonblocking. It is also not part of the set returned by query_callbacks.

See also

  query_alert_callback