public abstract class BaseServerTransport extends Object implements ServerTransport
ServerTransport.| Modifier and Type | Field and Description |
|---|---|
protected io.cettia.platform.action.Actions<ByteBuffer> |
binaryActions |
protected io.cettia.platform.action.Actions<Void> |
closeActions |
protected io.cettia.platform.action.Actions<Throwable> |
errorActions |
protected io.cettia.platform.action.Actions<String> |
textActions |
| Constructor and Description |
|---|
BaseServerTransport() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
protected abstract void |
doClose() |
protected abstract void |
doSend(ByteBuffer data) |
protected abstract void |
doSend(String data) |
ServerTransport |
onbinary(io.cettia.platform.action.Action<ByteBuffer> action)
Attaches an action for the binary message.
|
ServerTransport |
onclose(io.cettia.platform.action.Action<Void> action)
Attaches an action for the close event.
|
ServerTransport |
onerror(io.cettia.platform.action.Action<Throwable> action)
Executed if there was any error on the connection.
|
ServerTransport |
ontext(io.cettia.platform.action.Action<String> action)
Attaches an action for the text message.
|
ServerTransport |
send(ByteBuffer data)
Sends a binary message through the connection.
|
BaseServerTransport |
send(String data)
Sends a text message through the connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitunwrap, uriprotected io.cettia.platform.action.Actions<String> textActions
protected io.cettia.platform.action.Actions<ByteBuffer> binaryActions
protected io.cettia.platform.action.Actions<Throwable> errorActions
protected io.cettia.platform.action.Actions<Void> closeActions
public ServerTransport ontext(io.cettia.platform.action.Action<String> action)
ServerTransportontext in interface ServerTransportpublic ServerTransport onbinary(io.cettia.platform.action.Action<ByteBuffer> action)
ServerTransportonbinary 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 onerror(io.cettia.platform.action.Action<Throwable> action)
ServerTransportonerror in interface ServerTransportpublic ServerTransport onclose(io.cettia.platform.action.Action<Void> action)
ServerTransportonclose in interface ServerTransportpublic void close()
ServerTransportclose in interface ServerTransportprotected abstract void doClose()
Copyright 2015, The Cettia Project