A callback event signaling failure of an ack request.
A callback event signaling failure of an ack request. This is not handled automatically and you have to decide what you want to do with the message, you could send it again, send it somewhere else, drop it ...
An io.backchat.hookup.OutboundMessage outbound message
Adds acking support to a message This can only be included in a websocket out message
Interface trait to which fallback mechanisms must adhere to It implements java.io.Closeable so you can use it as a resource
A message representing an array of bytes sent to/received from a remote party.
A message representing an array of bytes sent to/received from a remote party.
An Array of Bytes representing the content of the message
A broadcast channel represents a connection
Broadcast channel like is either a connection or a proxy for a connection.
Broadcast channel like is either a connection or a proxy for a connection. It contains the methods for sending and disconnecting from a socket
A trait describing a client that can connect to something
Configuration for content compression
Configuration for content compression
the compression level
Usage of the simple websocket client:
Usage of the simple websocket client:
new DefaultHookupClient(HookupClientConfig(new URI("ws://localhost:8080/thesocket"))) { def receive = { case Disconnected(_) ⇒ println("The websocket to " + uri.toASCIIString + " disconnected.") case TextMessage(message) ⇒ { println("RECV: " + message) send("ECHO: " + message) } } connect() onSuccess { case Success ⇒ println("The websocket is connected.") case _ ⇒ } }
A callback event signaling that the connection has ended, if the cause was an exception thrown then the cause object will be filled in.
A callback event signaling that the connection has ended, if the cause was an exception thrown then the cause object will be filled in.
A scala.Option of java.lang.Throwable
A callback event signaling that an error has occurred.
A callback event signaling that an error has occurred. if the error was an exception thrown then the cause object will be filled in.
A scala.Option of java.lang.Throwable
The file to use as favico.ico response.
The file to use as favico.ico response. If you use the public directory capabillity you can also place a file in the public directory named favico.{ico,png,gif} and the static file server will serve the request.
The java.io.File to use as base path
The default file buffer.
The default file buffer. This is a file buffer that also has a memory buffer to which it writes when the file stream is being read out or if a write to the file failed.
This class has no maximum size or any limits attached to it yet. So it is possible for this class to exhaust the memory and/or disk space of the machine using this buffer.
The configuration for the flash policy xml
The configuration for the flash policy xml
the domain to accept connections for
the ports to accept connections on
The Hookup client provides a client for the hookup server, it doesn't lock you in to using a specific message format.
The Hookup client provides a client for the hookup server, it doesn't lock you in to using a specific message format. The default implementation uses websockets to communicate with the server. You can opt-in or opt-out of every feature in the hookup client through configuration.
Usage of the simple hookup client:
new HookupClient { val uri = new URI("ws://localhost:8080/thesocket") def receive = { case Disconnected(_) ⇒ println("The websocket to " + uri.toASCIIString + " disconnected.") case TextMessage(message) ⇒ { println("RECV: " + message) send("ECHO: " + message) } } connect() onSuccess { case Success ⇒ println("The websocket to " + uri.toASCIIString + "is connected.") case _ ⇒ } }
The configuration of a websocket client.
The configuration of a websocket client.
The java.net.URI to connect to.
The version of the websocket handshake to use, defaults to the most recent version.
The headers to send along with the handshake request.
The protocols this websocket client can understand
the default protocol this client should use
The timeout for pinging.
The buffer to use when the connection to the server is lost.
The throttle to use as reconnection schedule.
The execution context for futures.
A trait describing an entity that can handle inbound messages
Netty based HookupServer requires netty 3.4.x or later
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
Type forwarder for a websocket server client
A marker trait for inbound messages
Represents a back off strategy that will retry forever when the maximum wait has been reached From then on it will continue to use the max wait as delay.
Represents a back off strategy that will retry forever when the maximum wait has been reached From then on it will continue to use the max wait as delay.
An scala.concurrent.duration.Duration indicating how long to wait for the next operation can occur
An scala.concurrent.duration.Duration indicating the maximum value a delay
can have
A mixin for a io.backchat.hookup.HookupClient with helper methods for the java api.
A mixin for a io.backchat.hookup.HookupClient with helper methods for the java api. When mixed into a websocket it is a full implementation that notifies the registered io.backchat.hookup.WebSocketListener instances when events occur.
A java friendly websocket
A java friendly websocket
A message representing a json object sent to/received from a remote party.
A message representing a json object sent to/received from a remote party.
A org.json4s.JValue object
A protocol that supports all the features of the websocket server.
A protocol that supports all the features of the websocket server. This wireformat knows about acking and the related protocol messages. it uses a json object to transfer meaning everything has a property name.
The maximum frame size for a websocket connection
Represents a back off strategy that will retry for maxTimes
when the maximum wait has been reached
When it can't connect within the maxTimes
a maxValue
can occur it will return a io.backchat.hookup.NoThrottle strategy
Represents a back off strategy that will retry for maxTimes
when the maximum wait has been reached
When it can't connect within the maxTimes
a maxValue
can occur it will return a io.backchat.hookup.NoThrottle strategy
An scala.concurrent.duration.Duration indicating how long to wait for the next operation can occur
An scala.concurrent.duration.Duration indicating the maximum value a delay
can have
A scala.Int representing the maximum amount of time a maxWait can be repeated
The interface to represent a result from an operation These results can indicate Success, Cancellation or a sequence of operation results
A marker trait for outbound messages
The configuration for sending pings to a client.
The configuration for sending pings to a client. (Some websocket clients don't support ping frames)
the timeout for a connection to be idle before sending a ping.
A base trait for creating messages of different content types
A base trait for creating messages of different content types
The type of content this protocol message represents
The directory to use as a base directory for serving static files.
The directory to use as a base directory for serving static files.
The java.io.File to use as base path
A trait describing a client that can reconnect to a server.
A list of operation results, contains some aggregate helper methods in addition to a populated list of children
A list of operation results, contains some aggregate helper methods in addition to a populated list of children
a scala.List of io.backchat.hookup.OperationResult objects
A trait to wrap a server in so it can be used by components that depend on a most basic interfae.
A marker trait to indicate something is a a configuration for the server.
Main configuration object for a server
Main configuration object for a server
The name of this server, defaults to BackchatWebSocketServer
The version of the server
Which address the server should listen on
The port the server should listen on
The default protocol for this server to use when no subprotocols have been specified
A sequence of io.backchat.hookup.ServerCapability configurations for this server
A protocol format that is just plain and simple json.
A protocol format that is just plain and simple json. This protocol doesn't support acking. It looks at the first character in the message and if it thinks it's JSON it will try to parse it as JSON otherwise it creates a text message
Configuration for adding ssl support to the server
Configuration for adding ssl support to the server
path to the keystore, by default it looks for the system property keystore.file.path
path to the keystore, by default it looks for the system property keystore.file.path
path to the keystore, by default it looks for the system property keystore.file.path
The subprotocols this server can respond to.
The subprotocols this server can respond to.
A supported protocol name
remaining supported protocols
A message representing a text object sent to/received from a remote party.
A message representing a text object sent to/received from a remote party.
A scala.Predef.String representing the content of the message
The interface for an immutable backoff schedule
A base class for the java api to listen for websocket events.
The interface trait for a wire format.
The interface trait for a wire format. Creating a new wire format means implementing these 3 methods.
This object was generated by sbt-buildinfo.
An object indicating a failure result
A callback event signaling that the connection has been fully established.
A callback event signaling that the connection has been fully established. This means that any handshakes have been completed successfully too.
When you receive this callback message you can be sure there is someone on the other end.
The default protocol for the hookup server to use.
The default protocol for the hookup server to use. By default this a simple json protocol that doesn't support any advanced features but just sends json messages back and forth
The default protocols hookup understands
Companion object for the io.backchat.hookup.FileBuffer
A Null object representing no backing off at all
A callback event signaling that the connection to the server has been broken and the client is trying to reconnect.
A callback event signaling that the connection to the server has been broken and the client is trying to reconnect. Every reconnect attempt fires this message.
Typically you don't need to do anything when this happens, if you use a backoff like io.backchat.hookup.IndefiniteThrottle then the client does the reconnection bit automatically, it's only then that you can expect these events.
An object indicating a success result
An implicit conversion from a org.jboss.netty.channel.ChannelFuture to an scala.concurrent.Future
An implicit conversion from a org.jboss.netty.channel.ChannelFuture to an scala.concurrent.Future
The org.jboss.netty.channel.ChannelFuture
A scala.concurrent.Future
An implicit conversion from a predicate function that takes a io.backchat.hookup.BroadcastChannel to a io.backchat.hookup.HookupServer.BroadcastFilter
An implicit conversion from a predicate function that takes a io.backchat.hookup.BroadcastChannel to a io.backchat.hookup.HookupServer.BroadcastFilter
The predicate function to convert to a filter
Implicit conversion from a json4s jvalue to a io.backchat.hookup.JsonMessage
Implicit conversion from a json4s jvalue to a io.backchat.hookup.JsonMessage
The string content of the message
The default protocol for the hookup server to use.
The default protocol for the hookup server to use. By default this a simple json protocol that doesn't support any advanced features but just sends json messages back and forth
The package object for the library. This contains some implicit conversions to smooth the api over and allow for a single import at the top of a file to get the api working.