Packages

object impl

Source
WebSocket.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. impl
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def computeFingerPrint(key: ByteVector): ByteVector
  7. def computeHandshakeResponse(header: HttpRequestHeader, key: ByteVector): HttpResponseHeader

    creates the handshake response to complete websocket handshake on server side *

  8. def controlStream[F[_]](pingPongs: Stream[F, PingPong], metronome: Stream[F, Unit], maxUnanswered: Int, flag: Boolean)(implicit F: Async[F]): Stream[F, WebSocketFrame]

    Creates control stream.

    Creates control stream. When control stream terminates WebSocket will terminate too.

    This takes ping-pong stream, for each Ping, this responds with Pong. For each Pong received this zeroes number of pings sent.

    pingPongs

    Stream of ping pongs received

    metronome

    A metronome that emits time to send Ping

    maxUnanswered

    Max unanswered pings to await before the stream terminates.

  9. def createRequestHeaders(header: HttpRequestHeader, random: ⇒ ByteVector = randomBytes(16)): (HttpRequestHeader, ByteVector)

    Augments header to be correct for Websocket request (adding Sec-WebSocket-Key header) and returnng the correct header with expected SHA-1 response from the server

    Augments header to be correct for Websocket request (adding Sec-WebSocket-Key header) and returnng the correct header with expected SHA-1 response from the server

    random

    Random generator of 16 byte websocket keys

  10. def cutFrame(in: ByteVector): Option[ByteVector]

    Cuts necessary data for decoding the frame, done by partially decoding the frame Empty if the data couldn't be decoded yet

    Cuts necessary data for decoding the frame, done by partially decoding the frame Empty if the data couldn't be decoded yet

    in

    Current buffer that may contain full frame

  11. def decodeWebSocketFrame[F[_]](maxFrameSize: Int, flag: Boolean): Pipe[F, Byte, WebSocketFrame]

    Decodes websocket frame.

    Decodes websocket frame.

    This will fail when the frame failed to be decoded or when frame is larger than supplied maxFrameSize parameter.

    maxFrameSize

    Maximum size of the frame, including its header.

  12. def encodeWebSocketFrame[F[_]](flag: Boolean): Pipe[F, WebSocketFrame, Byte]

    Encodes incoming frames to wire format.

  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def frame2WebSocketFrame[F[_], A](maskKey: ⇒ Option[Int])(implicit W: Encoder[A]): Pipe[F, Frame[A], WebSocketFrame]

    Encodes received frome to WebSocketFrame.

    Encodes received frome to WebSocketFrame.

    maskKey

    A funtion that allows to generate random masking key. Masking is applied at client -> server direction only.

  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. val magic: ByteVector
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  24. def randomBytes(size: Int): ByteVector

    random generator, ascii compatible *

  25. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. def validateResponse[F[_]](request: HttpRequestHeader, response: HttpResponseHeader, expectFingerPrint: ByteVector): Stream[F, Option[HttpResponseHeader]]

    Validates response received.

    Validates response received. If other than 101 status code is received, this evaluates to Some() If fingerprint won't match or the websocket headers wont match the request, this fails.

    request

    Sent request header

    response

    received header

    expectFingerPrint

    expected fingerprint in header

  28. def verifyHeaderRequest[F[_]](header: HttpRequestHeader): Either[HttpResponse[F], ByteVector]

    Verifies validity of WebSocket header request (on server) and extracts WebSocket key

  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def webSocketFrame2Frame[F[_], A](pongQ: Queue[F, PingPong])(implicit R: Decoder[A]): Pipe[F, WebSocketFrame, Frame[A]]

    Collects incoming frames.

    Collects incoming frames. to produce and deserialize Frame[A].

    Also interprets WebSocket operations.

    • if Ping is received, supplied Queue is enqueued with true
    • if Pong is received, supplied Queue is enqueued with false
    • if Close is received, the WebSocket is terminated
    • if Continuation is received, the buffer of the frame is enqueued and later used to deserialize to A.
    pongQ

    Queue to notify about ping/pong frames.

  33. def webSocketOf[F[_], I, O](pipe: Pipe[F, Frame[I], Frame[O]], pingInterval: Duration, maxFrameSize: Int, client2Server: Boolean)(implicit R: Decoder[I], W: Encoder[O], F: Async[F], S: Scheduler): Pipe[F, Byte, Byte]

    Creates websocket of supplied pipe

    Creates websocket of supplied pipe

    pingInterval

    If Finite, defines duration when keep-alive pings are sent to client If client won't respond with pong to 3x this internal, the websocket will be terminated by server.

    client2Server

    When true, this represent client -> server direction, when false this represents reverse direction

Inherited from AnyRef

Inherited from Any

Ungrouped