org.mashupbots.socko.events

WebSocketFrameEvent

case class WebSocketFrameEvent(context: ChannelHandlerContext, initialHttpRequest: InitialHttpRequestMessage, wsFrame: WebSocketFrame, config: WebSocketEventConfig) extends SockoEvent with Product with Serializable

Event fired when a web socket text or binary frame is received.

A org.mashupbots.socko.events.WebSocketFrameEvent will only be fired after an initial org.mashupbots.socko.events.WebSocketHandshakeEvent has been successfully processed.

initialHttpRequest

The initial HTTP request

wsFrame

Incoming data for processing

config

Web Socket configuration

Linear Supertypes
Serializable, Serializable, Product, Equals, SockoEvent, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. WebSocketFrameEvent
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. SockoEvent
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new WebSocketFrameEvent(context: ChannelHandlerContext, initialHttpRequest: InitialHttpRequestMessage, wsFrame: WebSocketFrame, config: WebSocketEventConfig)

    initialHttpRequest

    The initial HTTP request

    wsFrame

    Incoming data for processing

    config

    Web Socket configuration

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def close(): Unit

    Close the web socket connection

  9. val config: WebSocketEventConfig

    Web Socket configuration

  10. val context: ChannelHandlerContext

    Netty channel associated with this request

    Netty channel associated with this request

    Definition Classes
    WebSocketFrameEventSockoEvent
  11. val createdOn: Date

    Timestamp when this event was fired

    Timestamp when this event was fired

    Definition Classes
    SockoEvent
  12. def duration(): Long

    Number of milliseconds from the time when this context was created

    Number of milliseconds from the time when this context was created

    Definition Classes
    SockoEvent
  13. val endPoint: EndPoint

    HTTP end point used by this chunk

    HTTP end point used by this chunk

    Definition Classes
    WebSocketFrameEventSockoEvent
  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. val initialHttpRequest: InitialHttpRequestMessage

    The initial HTTP request

  18. val isBinary: Boolean

    Indicates a binary frame

  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. val isText: Boolean

    Indicates a text frame

  21. lazy val items: Map[String, Any]

    Store of items that can be used to pass data from route to processor and between processors.

    Store of items that can be used to pass data from route to processor and between processors.

    This map is not synchronized and not thread-safe. In most cases, we expect this cache to be used by a single thread - hence a standard map is faster.

    If you do need to use a thread safe map, from your route, instance and store a ConcurrentHashMap as an item in this cache.

    Definition Classes
    SockoEvent
  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. val protocolVersion: String

    Web socket version

  26. def readBinary(): Array[Byte]

    Returns the request content as byte array

  27. def readText(): String

    Returns the request content as a string.

    Returns the request content as a string. UTF-8 character encoding is assumed

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. var username: Option[String]

    Username of the authenticated user.

    Username of the authenticated user. You need to set this for it to appear in the web logs.

    Socko does not make assumptions on your authentication method. You do it and set this username to let us know.

    Definition Classes
    SockoEvent
  30. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. val webSocketId: String

    Unique ID for this web socket connection

    Unique ID for this web socket connection

    With Netty 5, we can use ChannelId. However, this is not supported in Netty 4 so we'll have to use UUID

  34. def writeBinary(binary: Array[Byte]): Unit

    Sends a binary web socket frame back to the client

    Sends a binary web socket frame back to the client

    binary

    Binary data to return to the client

  35. def writeText(text: String): Unit

    Sends a text web socket frame back to the client

    Sends a text web socket frame back to the client

    text

    Text to send to the client

  36. def writeWebLog(method: String, uri: String, requestSize: Long, responseStatusCode: Int, responseSize: Long): Unit

    Adds an entry to the web log.

    Adds an entry to the web log.

    Web logs were designed for request/response style interaction and not the duplex communication channel of websockets.

    By default, Socko does not write web logs for websocket frames. This is because Socko does not know the context of your frames. However, you can write web logs by calling this method from your route or actor processor.

    If you have authenticated the user, you can set it in this.username.

    method

    Can be used to describe the operation or the message type. No spaces allowed.

    uri

    Can be used to provide context. Querystring is also permissible.

    requestSize

    Length of request frame. Set to 0 if none.

    responseStatusCode

    Status code

    responseSize

    Length of response frame in bytes. Set to 0 if none.

  37. val wsFrame: WebSocketFrame

    Incoming data for processing

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from SockoEvent

Inherited from AnyRef

Inherited from Any

Ungrouped