Package dev.relism.flash.transport
Record Class ConnectionContext
java.lang.Object
java.lang.Record
dev.relism.flash.transport.ConnectionContext
- Record Components:
socket- the accepted socket — owns its lifecycle (closing it is the caller's, i.e.ConnectionRunner's, responsibility, not the protocol's)sslSocket-socketnarrowed toSSLSocket, ornullfor a plaintext connectionin- the single buffered, deadline-aware source for this connection's inbound bytesout- the buffered output stream — for header/body writes that benefit from userspace coalescing before a single syscallrawOut- the unbuffered output stream — for WebSocket, whose writes are already bulk (seeWebSocketSession)remoteAddress- the client's address, ornullif unavailablerouter- the HTTP routerwsRouter- the WebSocket routerconfiguration- the server configuration (timeouts, limits, feature flags)stopped-trueonce the server has begun shutting down — a protocol implementation's request loop must check this and exit promptly
public record ConnectionContext(Socket socket, SSLSocket sslSocket, BufferedByteSource in, OutputStream out, OutputStream rawOut, InetSocketAddress remoteAddress, ConnectionScratch scratch, AbstractRouter router, AbstractWsRouter wsRouter, FlashConfiguration configuration, ExecutorService executor, BooleanSupplier stopped)
extends Record
Everything a
ConnectionProtocol implementation needs to serve one connection, bundled
into a single object instead of a long parameter list.-
Constructor Summary
ConstructorsConstructorDescriptionConnectionContext(Socket socket, SSLSocket sslSocket, BufferedByteSource in, OutputStream out, OutputStream rawOut, InetSocketAddress remoteAddress, ConnectionScratch scratch, AbstractRouter router, AbstractWsRouter wsRouter, FlashConfiguration configuration, ExecutorService executor, BooleanSupplier stopped) Creates an instance of aConnectionContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconfigurationrecord component.final booleanIndicates whether some other object is "equal to" this one.executor()Returns the value of theexecutorrecord component.final inthashCode()Returns a hash code value for this object.in()Returns the value of theinrecord component.out()Returns the value of theoutrecord component.rawOut()Returns the value of therawOutrecord component.Returns the value of theremoteAddressrecord component.router()Returns the value of therouterrecord component.scratch()Returns the value of thescratchrecord component.socket()Returns the value of thesocketrecord component.Returns the value of thesslSocketrecord component.stopped()Returns the value of thestoppedrecord component.final StringtoString()Returns a string representation of this record class.wsRouter()Returns the value of thewsRouterrecord component.
-
Constructor Details
-
ConnectionContext
public ConnectionContext(Socket socket, SSLSocket sslSocket, BufferedByteSource in, OutputStream out, OutputStream rawOut, InetSocketAddress remoteAddress, ConnectionScratch scratch, AbstractRouter router, AbstractWsRouter wsRouter, FlashConfiguration configuration, ExecutorService executor, BooleanSupplier stopped) Creates an instance of aConnectionContextrecord class.- Parameters:
socket- the value for thesocketrecord componentsslSocket- the value for thesslSocketrecord componentin- the value for theinrecord componentout- the value for theoutrecord componentrawOut- the value for therawOutrecord componentremoteAddress- the value for theremoteAddressrecord componentscratch- the value for thescratchrecord componentrouter- the value for therouterrecord componentwsRouter- the value for thewsRouterrecord componentconfiguration- the value for theconfigurationrecord componentexecutor- the value for theexecutorrecord componentstopped- the value for thestoppedrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
socket
Returns the value of thesocketrecord component.- Returns:
- the value of the
socketrecord component
-
sslSocket
Returns the value of thesslSocketrecord component.- Returns:
- the value of the
sslSocketrecord component
-
in
Returns the value of theinrecord component.- Returns:
- the value of the
inrecord component
-
out
Returns the value of theoutrecord component.- Returns:
- the value of the
outrecord component
-
rawOut
Returns the value of therawOutrecord component.- Returns:
- the value of the
rawOutrecord component
-
remoteAddress
Returns the value of theremoteAddressrecord component.- Returns:
- the value of the
remoteAddressrecord component
-
scratch
Returns the value of thescratchrecord component.- Returns:
- the value of the
scratchrecord component
-
router
Returns the value of therouterrecord component.- Returns:
- the value of the
routerrecord component
-
wsRouter
Returns the value of thewsRouterrecord component.- Returns:
- the value of the
wsRouterrecord component
-
configuration
Returns the value of theconfigurationrecord component.- Returns:
- the value of the
configurationrecord component
-
executor
Returns the value of theexecutorrecord component.- Returns:
- the value of the
executorrecord component
-
stopped
Returns the value of thestoppedrecord component.- Returns:
- the value of the
stoppedrecord component
-