public class UdpTransportServer extends ServiceBase implements TransportServer
ServiceBase.CallbackSupport, ServiceBase.STARTING, ServiceBase.State, ServiceBase.STOPPING| Modifier and Type | Field and Description |
|---|---|
private java.net.InetSocketAddress |
bindAddress |
private java.lang.String |
bindScheme |
private java.util.concurrent.Executor |
blockingExecutor |
private java.nio.channels.DatagramChannel |
channel |
private DispatchQueue |
dispatchQueue |
private TransportServerListener |
listener |
private UdpTransport |
transport |
_serviceState, CREATED, STARTED, STOPPED| Constructor and Description |
|---|
UdpTransportServer(java.net.URI location) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
_start(Task onCompleted) |
protected void |
_stop(Task onCompleted) |
private void |
accept() |
protected UdpTransport |
createTransport() |
java.util.concurrent.Executor |
getBlockingExecutor() |
java.lang.String |
getBoundAddress() |
DispatchQueue |
getDispatchQueue()
Returns the dispatch queue used by the transport
|
java.net.InetSocketAddress |
getSocketAddress() |
private void |
queueAccept() |
void |
resume()
resume accepting new transports
|
void |
setBlockingExecutor(java.util.concurrent.Executor blockingExecutor) |
void |
setDispatchQueue(DispatchQueue dispatchQueue)
Sets the dispatch queue used by the transport
|
void |
setTransportServerListener(TransportServerListener listener)
Registers an
TransportAcceptListener which is notified of accepted
channels. |
void |
suspend()
suspend accepting new transports
|
java.lang.String |
toString() |
getServiceState, start, start, stop, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitstart, start, stop, stopprivate final java.lang.String bindScheme
private final java.net.InetSocketAddress bindAddress
private java.nio.channels.DatagramChannel channel
private TransportServerListener listener
private DispatchQueue dispatchQueue
private java.util.concurrent.Executor blockingExecutor
private UdpTransport transport
public UdpTransportServer(java.net.URI location)
throws java.net.UnknownHostException
java.net.UnknownHostExceptionpublic void setTransportServerListener(TransportServerListener listener)
TransportServerTransportAcceptListener which is notified of accepted
channels.setTransportServerListener in interface TransportServerpublic java.net.InetSocketAddress getSocketAddress()
getSocketAddress in interface TransportServerpublic DispatchQueue getDispatchQueue()
TransportServergetDispatchQueue in interface TransportServergetDispatchQueue in class ServiceBasepublic void setDispatchQueue(DispatchQueue dispatchQueue)
TransportServersetDispatchQueue in interface TransportServerprotected void _start(Task onCompleted)
_start in class ServiceBaseprivate void queueAccept()
private void accept()
protected UdpTransport createTransport()
protected void _stop(Task onCompleted)
_stop in class ServiceBasepublic void suspend()
TransportServersuspend in interface TransportServerpublic void resume()
TransportServerresume in interface TransportServerpublic java.lang.String getBoundAddress()
getBoundAddress in interface TransportServerpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.concurrent.Executor getBlockingExecutor()
getBlockingExecutor in interface TransportServerpublic void setBlockingExecutor(java.util.concurrent.Executor blockingExecutor)
setBlockingExecutor in interface TransportServer