scoop:scoop.http.server:0.1.0
src/websocket/completion.scoop
Selected production source · src/websocket/completion.scoop
1
package scoop.http.server3
import scoop.http.WebSocketClose4
import scoop.time.Duration6
/** Immutable upgrade facts without an HTTP request, response or request-scoped resource. */7
public class WebSocketContext internal constructor(8
/** The identifier of the completed upgrade request. */9
public val requestId: String,10
/** The selected endpoint metadata. */11
public val route: HttpRouteInfo?,12
/** The underlying connection's immutable protocol and TLS facts. */13
public val connection: HttpConnectionInfo,14
/** The actually selected subprotocol, or None. */15
public val protocol: String?16
)18
/** A WebSocket connection's outcome after all local cleanup has completed. */19
public enum HttpWebSocketOutcome {20
/** Business work and session cleanup ended without failure. */21
Completed,22
/** Server drain or cooperative cancellation ended the session. */23
Cancelled,24
/** Application, protocol, transport or cleanup failed. */25
Failed26
}28
/** Final facts for an upgraded connection, including handoffs stopped before business work starts. */29
public class HttpWebSocketCompletion internal constructor(30
/** The independent upgrade snapshot. */31
public val context: WebSocketContext,32
/** Time from upgrade reservation through actual session and transport cleanup. */33
public val elapsed: Duration,34
/** The peer Close frame, if received. */35
public val peerClose: WebSocketClose?,36
/** The local Close frame, if sent. */37
public val sentClose: WebSocketClose?,38
/** The final lifecycle outcome. */39
public val outcome: HttpWebSocketOutcome,40
/** The original terminal failure, absent for clean completion or graceful drain. */41
public val failure: Throwable?42
)