public abstract class BaseServerTransport extends Object implements ServerTransport
ServerTransport.| Modifier and Type | Field and Description |
|---|---|
protected Actions<ByteBuffer> |
binaryActions |
protected Actions<Void> |
closeActions |
protected Actions<Throwable> |
errorActions |
protected Actions<String> |
textActions |
| Constructor and Description |
|---|
BaseServerTransport() |
| Modifier and Type | Method and Description |
|---|---|
ServerTransport |
binaryAction(Action<ByteBuffer> action)
Attaches an action for the binary message.
|
void |
close()
Closes the connection.
|
ServerTransport |
closeAction(Action<Void> action)
Attaches an action for the close event.
|
protected abstract void |
doClose() |
protected abstract void |
doSend(ByteBuffer data) |
protected abstract void |
doSend(String data) |
ServerTransport |
errorAction(Action<Throwable> action)
Executed if there was any error on the connection.
|
ServerTransport |
send(ByteBuffer data)
Sends a binary message through the connection.
|
BaseServerTransport |
send(String data)
Sends a text message through the connection.
|
ServerTransport |
textAction(Action<String> action)
Attaches an action for the text message.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitunwrap, uriprotected Actions<ByteBuffer> binaryActions
public ServerTransport textAction(Action<String> action)
ServerTransporttextAction in interface ServerTransportpublic ServerTransport binaryAction(Action<ByteBuffer> action)
ServerTransportbinaryAction in interface ServerTransportpublic BaseServerTransport send(String data)
ServerTransportsend in interface ServerTransportpublic ServerTransport send(ByteBuffer data)
ServerTransportsend in interface ServerTransportprotected abstract void doSend(String data)
protected abstract void doSend(ByteBuffer data)
public ServerTransport errorAction(Action<Throwable> action)
ServerTransporterrorAction in interface ServerTransportpublic ServerTransport closeAction(Action<Void> action)
ServerTransportcloseAction in interface ServerTransportpublic void close()
ServerTransportclose in interface ServerTransportprotected abstract void doClose()
Copyright 2014, The Vibe Project