Package com.apollographql.apollo3.network.ws

Types

Link copied to clipboard
class AppSyncWsProtocol(    connectionAcknowledgeTimeoutMs: Long,     connectionPayload: suspend () -> Map<String, Any?>? = { null },     webSocketConnection: WebSocketConnection,     listener: WsProtocol.Listener) : WsProtocol

A WsProtocol for https://docs.aws.amazon.com/appsync/latest/devguide/real-time-websocket-client.html

Link copied to clipboard
actual class DefaultWebSocketEngine : WebSocketEngine
expect class DefaultWebSocketEngine : WebSocketEngine
actual class DefaultWebSocketEngine : WebSocketEngine
actual class DefaultWebSocketEngine : WebSocketEngine
Link copied to clipboard
class GraphQLWsProtocol : WsProtocol

An WsProtocol that uses https://github.com/enisdenjo/graphql-ws/blob/master/PROTOCOL.md It can carry queries in addition to subscriptions over the websocket

Link copied to clipboard
typealias NSWebSocketFactory = (NSURLRequest, WebSocketConnectionListener) -> NSURLSessionWebSocketTask
Link copied to clipboard
class SubscriptionWsProtocol @JvmOverloads constructor(    webSocketConnection: WebSocketConnection,     listener: WsProtocol.Listener,     connectionAcknowledgeTimeoutMs: Long,     connectionPayload: suspend () -> Map<String, Any?>? = { null },     frameType: WsFrameType = WsFrameType.Text) : WsProtocol

A WsProtocol for https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md

Link copied to clipboard
open class SubscriptionWsProtocolAdapter(webSocketConnection: WebSocketConnection, listener: WsProtocol.Listener) : WsProtocol
Link copied to clipboard
interface WebSocketConnection
Link copied to clipboard
interface WebSocketConnectionListener
Link copied to clipboard
interface WebSocketEngine

The low-level WebSocket API. Implement this interface to customize how WebSockets are handled

Link copied to clipboard
class WebSocketNetworkTransport : NetworkTransport

A NetworkTransport that works with WebSockets. Usually it is used with subscriptions but some WsProtocols like GraphQLWsProtocol also support queries and mutations.

Link copied to clipboard
enum WsFrameType : Enum<WsFrameType>
Link copied to clipboard
abstract class WsProtocol(webSocketConnection: WebSocketConnection, listener: WsProtocol.Listener)

A WsProtocol is responsible for handling the details of the WebSocket protocol.

Functions

Link copied to clipboard
fun NetworkTransport.closeConnection(reason: Throwable)

A shorthand for WebSocketNetworkTransport.closeConnection. If the NetworkTransport is not a WebSocketNetworkTransport, a NotImplementedError is thrown.

Properties

Link copied to clipboard
const val CLOSE_GOING_AWAY: Int = 1001
Link copied to clipboard
const val CLOSE_NORMAL: Int = 1000