io.backchat.hookup

HookupServer

class HookupServer extends Server

Netty based HookupServer requires netty 3.4.x or later

Usage:

val server = HookupServer(ServerInfo("MyWebSocketServer")) {
  new HookupServerClient {
    protected val receive = {
      case Connected ¬ヌメ println("got a client connection")
      case TextMessage(text) ¬ヌメ send(TextMessage("ECHO: " + text))
      case Disconnected(_) ¬ヌメ println("client disconnected")
    }
  }
}
server.start
// time passes......
server.stop
Linear Supertypes
Server, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HookupServer
  2. Server
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HookupServer(config: ServerInfo, factory: ⇒ HookupServerClient)

    config

    A io.backchat.hookup.ServerInfo to use as configuration for this server

    factory

    A by-name param that functions as factory for io.backchat.hookup.HookupServerClient

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. def addFirstInPipeline(pipe: ChannelPipeline): Unit

    This is the first place where you can add additional handlers to the pipeline.

    This is the first place where you can add additional handlers to the pipeline. The flashpolicy handler and connection tracker have been added at this point. if a message arrives in this handler it's been untouched. This is a great place to register a handler that deals with metrics like bytes read/transferred etc.

    pipe

    The pipeline to configure.

    Attributes
    protected
  7. def addLastInPipeline(pipe: ChannelPipeline): Unit

    This is the best place to add your application handler.

    This is the best place to add your application handler. If you want to use a web framework that uses it's own request abstraction, then this is the place to plug it in.

    pipe

    The pipeline to configure.

    Attributes
    protected
  8. def addPingSupport(pipe: ChannelPipeline): Unit

    If you want to replace the way pings are handled (for example to support sending new lines on a http stream) This is where you can override the handler addition to the pipeline

    If you want to replace the way pings are handled (for example to support sending new lines on a http stream) This is where you can override the handler addition to the pipeline

    Attributes
    protected
  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def broadcast(message: OutboundMessage): Future[ResultList]

    Broadcast a message to all open connections

    Broadcast a message to all open connections

    message

    the io.backchat.hookup.OutboundMessage to send.

    returns

    A future with the result of the operation, a io.backchat.hookup.ResultList

  11. def capabilities: Seq[ServerCapability]

    The capabilities this server is configured with

    The capabilities this server is configured with

    returns

    a sequence of io.backchat.hookup.ServerCapability objects

    Definition Classes
    HookupServerServer
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. val config: ServerInfo

    A io.backchat.hookup.ServerInfo to use as configuration for this server

  14. def configureBootstrap(): Unit

    Configure the server bootstrap.

    Configure the server bootstrap. This is the place to set socket options. By default it sets soLinger to 0, reuseAddress to true and child.tcpNoDelay to true

    Attributes
    protected
  15. def configureHttpSupport(pipe: ChannelPipeline): Unit

    If you want to replace the way http requests are handled and read this is the place to do it.

    If you want to replace the way http requests are handled and read this is the place to do it.

    pipe

    The pipeline to configure

    Attributes
    protected
  16. def configurePipeline(pipe: ChannelPipeline): Unit

    At this point the pipeline has been configured with flashpolicy, ssl, pinging and connection tracking.

    At this point the pipeline has been configured with flashpolicy, ssl, pinging and connection tracking. HTTP support has also been added to the pipeline. if websocket related messages arrive in this handler it should send them to upstream. And a http request that is a websocket upgrade request should also be sent upstream.

    pipe

    The pipeline to configure

    Attributes
    protected
  17. final def eq(arg0: AnyRef): Boolean

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

    Definition Classes
    AnyRef → Any
  19. implicit val executionContext: ExecutionContext

    Attributes
    protected
  20. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  22. def getPipeline: ChannelPipeline

    If you want to override the entire Netty Channel Pipeline that gets created override this method.

    If you want to override the entire Netty Channel Pipeline that gets created override this method. But you're basically throwing away all the features of this server.

    This is a factory method.

    returns

    the created org.jboss.netty.channel.ChannelPipeline

    Attributes
    protected
  23. def hashCode(): Int

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

    Definition Classes
    Any
  25. def listenOn: String

    The network address/host to listen on.

    The network address/host to listen on.

    returns

    The address

    Definition Classes
    HookupServerServer
  26. val logger: InternalLogger

    the org.jboss.netty.logging.InternalLogger to use as logger for this server.

    the org.jboss.netty.logging.InternalLogger to use as logger for this server. This logger is shared with the handlers by default so you only ever see a single source of messages The logger has the same name as the server.

    Attributes
    protected
  27. def name: String

    The name of this server

    The name of this server

    returns

    The name

    Definition Classes
    HookupServerServer
  28. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  31. def onStart(thunk: ⇒ Any): ListBuffer[() ⇒ Any]

    Attach blocks of code to be run when the server starts.

    Attach blocks of code to be run when the server starts.

    thunk

    the code to execute when the server starts

  32. def onStop(thunk: ⇒ Any): ListBuffer[() ⇒ Any]

    Attach blocks of code to be run when the server stops

    Attach blocks of code to be run when the server stops

    thunk

    the code to execute when the server stops

  33. def port: Int

    The port this server listens on.

    The port this server listens on.

    returns

    The port number

    Definition Classes
    HookupServerServer
  34. final def start: Unit

    Start this server

    Start this server

    Definition Classes
    HookupServerServer
  35. final def stop: Unit

    Stop this server.

    Stop this server.

    Definition Classes
    HookupServerServer
  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  37. def toString(): String

    Definition Classes
    AnyRef → Any
  38. def version: String

    The version of this server.

    The version of this server.

    returns

    The version number of this server, defaults to the version of the build.

    Definition Classes
    HookupServerServer
  39. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Server

Inherited from AnyRef

Inherited from Any

Ungrouped