public abstract class DatagramServer<IN,OUT> extends AbstractNetPeer<IN,OUT> implements NetServer<IN,OUT>
| Modifier | Constructor and Description |
|---|---|
protected |
DatagramServer(reactor.core.Environment env,
reactor.core.Reactor reactor,
java.net.InetSocketAddress listenAddress,
java.net.NetworkInterface multicastInterface,
ServerSocketOptions options,
reactor.io.encoding.Codec<reactor.io.Buffer,IN,OUT> codec,
java.util.Collection<reactor.function.Consumer<NetChannel<IN,OUT>>> consumers) |
| Modifier and Type | Method and Description |
|---|---|
protected java.net.InetSocketAddress |
getListenAddress()
Get the address to which this server is bound.
|
protected java.net.NetworkInterface |
getMulticastInterface()
Get the
NetworkInterface on which multicast will be performed. |
protected ServerSocketOptions |
getOptions()
Get the
ServerSocketOptions currently in effect. |
abstract reactor.core.composable.Stream<IN> |
in()
Retrieve the
Stream on which can be composed actions to take when data comes into
this DatagramServer. |
reactor.core.composable.Promise<java.lang.Void> |
join(java.net.InetAddress multicastAddress)
Join a multicast group.
|
abstract reactor.core.composable.Promise<java.lang.Void> |
join(java.net.InetAddress multicastAddress,
java.net.NetworkInterface iface)
Join a multicast group.
|
reactor.core.composable.Promise<java.lang.Void> |
leave(java.net.InetAddress multicastAddress)
Leave a multicast group.
|
abstract reactor.core.composable.Promise<java.lang.Void> |
leave(java.net.InetAddress multicastAddress,
java.net.NetworkInterface iface)
Leave a multicast group.
|
abstract reactor.function.batch.BatchConsumer<OUT> |
out()
Retrieve the
Stream into which data can accepted for sending to peers. |
abstract DatagramServer<IN,OUT> |
send(OUT data)
Send data to peers.
|
reactor.core.composable.Promise<java.lang.Boolean> |
start()
Start this server.
|
abstract DatagramServer<IN,OUT> |
start(java.lang.Runnable started)
Start and bind this NetServer to the configured listen port and notify the given
Consumer when the bind operation is complete. |
close, close, close, createChannel, doClose, doCloseChannel, getChannels, getCodec, getConsumers, getEnvironment, getReactor, iterator, notifyClose, notifyError, notifyOpen, notifyShutdown, notifyStart, register, selectprotected DatagramServer(@Nonnull
reactor.core.Environment env,
@Nonnull
reactor.core.Reactor reactor,
@Nullable
java.net.InetSocketAddress listenAddress,
@Nullable
java.net.NetworkInterface multicastInterface,
@Nonnull
ServerSocketOptions options,
@Nullable
reactor.io.encoding.Codec<reactor.io.Buffer,IN,OUT> codec,
@Nonnull
java.util.Collection<reactor.function.Consumer<NetChannel<IN,OUT>>> consumers)
public reactor.core.composable.Promise<java.lang.Boolean> start()
public abstract DatagramServer<IN,OUT> start(@Nullable java.lang.Runnable started)
NetServerConsumer when the bind operation is complete.public abstract DatagramServer<IN,OUT> send(OUT data)
data - the data to sendpublic abstract reactor.core.composable.Stream<IN> in()
Stream on which can be composed actions to take when data comes into
this DatagramServer.Streampublic abstract reactor.function.batch.BatchConsumer<OUT> out()
Stream into which data can accepted for sending to peers.BatchConsumer for sending data outpublic abstract reactor.core.composable.Promise<java.lang.Void> join(java.net.InetAddress multicastAddress,
java.net.NetworkInterface iface)
multicastAddress - multicast address of the group to joiniface - interface to use for multicastpublic reactor.core.composable.Promise<java.lang.Void> join(java.net.InetAddress multicastAddress)
multicastAddress - multicast address of the group to joinpublic abstract reactor.core.composable.Promise<java.lang.Void> leave(java.net.InetAddress multicastAddress,
java.net.NetworkInterface iface)
multicastAddress - multicast address of the group to leaveiface - interface to use for multicastpublic reactor.core.composable.Promise<java.lang.Void> leave(java.net.InetAddress multicastAddress)
multicastAddress - multicast address of the group to leaveprotected java.net.InetSocketAddress getListenAddress()
protected java.net.NetworkInterface getMulticastInterface()
NetworkInterface on which multicast will be performed.protected ServerSocketOptions getOptions()
ServerSocketOptions currently in effect.