java.lang.Object
org.miaixz.bus.http.plugin.httpv.CoverCall.Close
- Enclosing class:
CoverCall
Encapsulates information about a WebSocket closure.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intCustom status code indicating the WebSocket was canceled by the client.static final intCustom status code indicating the WebSocket was closed due to an unexpected exception.static final intCustom status code indicating the WebSocket was closed due to a network error.static final intCustom status code indicating the WebSocket was closed due to a timeout. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
CANCELED
public static final int CANCELEDCustom status code indicating the WebSocket was canceled by the client.- See Also:
-
EXCEPTION
public static final int EXCEPTIONCustom status code indicating the WebSocket was closed due to an unexpected exception.- See Also:
-
NETWORK_ERROR
public static final int NETWORK_ERRORCustom status code indicating the WebSocket was closed due to a network error.- See Also:
-
TIMEOUT
public static final int TIMEOUTCustom status code indicating the WebSocket was closed due to a timeout.- See Also:
-
-
Constructor Details
-
Close
Constructs a new Close event object.- Parameters:
code- The closing status code.reason- The reason for closing.
-
-
Method Details
-
getCode
public int getCode()- Returns:
- The closing status code.
-
getReason
- Returns:
- The reason for closing.
-
isCanceled
public boolean isCanceled()- Returns:
- True if the WebSocket was closed due to cancellation.
-
isException
public boolean isException()- Returns:
- True if the WebSocket was closed due to an exception.
-
isNetworkError
public boolean isNetworkError()- Returns:
- True if the WebSocket was closed due to a network error.
-
isTimeout
public boolean isTimeout()- Returns:
- True if the WebSocket was closed due to a network timeout.
-
toString
-