Class CloseReason


  • public class CloseReason
    extends Object
    An object, describing the reason why Connection was closed.
    Author:
    Alexey Stashok
    • Field Detail

      • LOCALLY_CLOSED_REASON

        public static final CloseReason LOCALLY_CLOSED_REASON
      • REMOTELY_CLOSED_REASON

        public static final CloseReason REMOTELY_CLOSED_REASON
    • Method Detail

      • getType

        public CloseType getType()
        Return information whether Connection was closed locally or remotely.
        Returns:
        information whether Connection was closed locally or remotely
      • getCause

        public IOException getCause()
        Returns information about an error, that caused the Connection to be closed. If the cause wasn't specified by user and it was closed locally then LOCALLY_CLOSED will be returned. If the cause wasn't specified by user and it was closed remotely then REMOTELY_CLOSED will be returned.
        Returns:
        information about an error, that caused the Connection to be closed
      • toString

        public String toString()
        Returns also type and cause.
        Overrides:
        toString in class Object