Class

play.socketio.scaladsl.SocketIO

SocketIOBuilder

Related Doc: package SocketIO

Permalink

class SocketIOBuilder[SessionData] extends AnyRef

A builder for engine.io instances.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SocketIOBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addNamespace[In, Out](decoder: SocketIOEventsDecoder[In], encoder: SocketIOEventsEncoder[Out])(callback: PartialFunction[(SocketIOSession[SessionData], String), Flow[In, Out, _]]): SocketIOBuilder[SessionData]

    Permalink

    Add a namespace.

    Add a namespace.

    This variant allows you to pass a callback that pattern matches on the namespace name, and uses the session data to decide whether the user should be able to connect to this namespace or not.

    Any exceptions thrown here will result in an error being sent back to the client, serialized by the errorHandler. Alternatively, you can simply not return a value from the partial function, which will result in an error being sent to the client that the namespace does not exist.

    decoder

    The decoder to use to decode messages.

    encoder

    The encoder to use to encode messages.

    callback

    A callback to match the namespace and create a flow accordingly.

  5. def addNamespace[In, Out](name: String, decoder: SocketIOEventsDecoder[In], encoder: SocketIOEventsEncoder[Out], flow: Flow[In, Out, _]): SocketIOBuilder[SessionData]

    Permalink

    Add a namespace.

    Add a namespace.

    name

    The name of the namespace.

    decoder

    The decoder to use to decode messages.

    encoder

    The encoder to use to encode messages.

    flow

    The flow to use for the namespace.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def createController(): EngineIOController

    Permalink

    Build the engine.io controller.

  9. def defaultNamespace[In, Out](decoder: SocketIOEventsDecoder[In], encoder: SocketIOEventsEncoder[Out])(callback: (SocketIOSession[SessionData]) ⇒ Flow[In, Out, _]): SocketIOBuilder[SessionData]

    Permalink

    Set the default namespace flow.

    Set the default namespace flow.

    This variant allows you to customise the returned flow according to the session.

    decoder

    the decoder to use.

    encoder

    the encoder to use.

    callback

    a callback to create the flow given the session.

  10. def defaultNamespace[In, Out](decoder: SocketIOEventsDecoder[In], encoder: SocketIOEventsEncoder[Out], flow: Flow[In, Out, _]): SocketIOBuilder[SessionData]

    Permalink

    Set the default namespace flow.

    Set the default namespace flow.

    decoder

    the decoder to use.

    encoder

    the encoder to use.

    flow

    the flow.

  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def onConnect[S <: SessionData](callback: (RequestHeader, String) ⇒ S): SocketIOBuilder[S]

    Permalink

    Set the onConnect callback.

    Set the onConnect callback.

    The callback takes the request header of the incoming connection and the id of the session, and should produce a session object, which can be anything, for example, a user principal, or other authentication and/or authorization details.

    If you wish to reject the connection, you can throw an exception, which will later be handled by the error handler to turn it into a message to send to the client.

  21. def onConnectAsync[S <: SessionData](callback: (RequestHeader, String) ⇒ Future[S]): SocketIOBuilder[S]

    Permalink

    Set the onConnect callback.

    Set the onConnect callback.

    The callback takes the request header of the incoming connection and the id of the ssion, and should produce a session object, which can be anything, for example, a user principal, or other authentication and/or authorization details.

    If you wish to reject the connection, you can throw an exception, which will later be handled by the error handler to turn it into a message to send to the client.

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

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. def withErrorHandler(handler: PartialFunction[Throwable, JsValue]): SocketIOBuilder[SessionData]

    Permalink

    Set the error handler.

    Set the error handler.

    If any errors are encountered, they will be serialized to JSON this function, and then passed to the client using a socket.io error message.

    Any errors not handled by this partial function will fallback to the existing error handler in this builder, which by default sends the exception message as a JSON string.

Inherited from AnyRef

Inherited from Any

Ungrouped