class WebSocket extends StrictLogging
WebSocket wrapper for com.ning.http.client.AsyncHttpClient
This is a thin wrapper for com.ning.http.client.AsyncHttpClient that exposes a functional API for attaching handlers to events that com.ning.http.client.AsyncHttpClient exposes.
You can chain nearly every method in this class. The single exception is the shutdown() method, which ends the life of this websocket. After executing it, you need to create a new instance of scalawebsocket.WebSocket
- Self Type
- WebSocket
- Alphabetic
- By Inheritance
- WebSocket
- StrictLogging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
WebSocket(client: AsyncHttpClient)
- client
preconfigured instance of the com.ning.http.client.AsyncHttpClient
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def close(): WebSocket
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
internalWebSocketListener: WebSocketListener { ... /* 2 definitions in type refinement */ }
Creates internal websocket listener.
Creates internal websocket listener.
This method creates the scalawebsocket.WebSocketListener and runs proper handlers on messages sent by that created listener.
- returns
an instance of scalawebsocket.WebSocketListener
- Attributes
- protected
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
logger: Logger
- Attributes
- protected
- Definition Classes
- StrictLogging
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def onBinaryMessage(handler: OnBinaryMessageHandler): WebSocket
- def onClose(handler: OnWebSocketOperationHandler): WebSocket
- def onError(handler: OnErrorHandler): WebSocket
- def onOpen(handler: OnWebSocketOperationHandler): WebSocket
- def onTextMessage(handler: OnTextMessageHandler): WebSocket
-
def
open(url: String): WebSocket
Open a websocket to the specified url
Open a websocket to the specified url
- url
url to connecto to
- returns
- def removeOnBinaryMessage(handler: OnBinaryMessageHandler): WebSocket
- def removeOnClose(handler: OnWebSocketOperationHandler): WebSocket
- def removeOnError(handler: OnErrorHandler): WebSocket
- def removeOnOpen(handler: OnWebSocketOperationHandler): WebSocket
- def removeOnTextMessage(handler: OnTextMessageHandler): WebSocket
- def send(message: Array[Byte]): WebSocket
- def sendText(message: String): WebSocket
-
def
shutdown(): Unit
Closes the underlying org.asynchttpclient.AsyncHttpClient client.
Closes the underlying org.asynchttpclient.AsyncHttpClient client.
This method is terminating the chain. After calling it, this instance of scalawebsocket.WebSocket is no longer useable.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )