Package org.drasyl.remote.handler
Class UdpServer
-
- All Implemented Interfaces:
Handler
public class UdpServer extends SimpleOutboundHandler<AddressedByteBuf,InetSocketAddressWrapper>
Binds to a udp port, sends outgoing messages via udp, and sends received udp packets to theDrasylPipeline
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
UDP_SERVER
-
Constructor Summary
Constructors Constructor Description UdpServer(io.netty.channel.EventLoopGroup bossGroup)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
eventTriggered(HandlerContext ctx, Event event, CompletableFuture<Void> future)
Gets called if aEvent
was emitted.protected void
matchedWrite(HandlerContext ctx, InetSocketAddressWrapper recipient, AddressedByteBuf addressedByteBuf, CompletableFuture<Void> future)
Is called for each message of typeSimpleOutboundHandler
.-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleOutboundHandler
acceptOutbound, write
-
Methods inherited from class org.drasyl.pipeline.skeleton.AddressHandlerAdapter
acceptAddress
-
Methods inherited from class org.drasyl.pipeline.skeleton.HandlerAdapter
exceptionCaught, handlerAdded, handlerRemoved, read
-
-
-
-
Field Detail
-
UDP_SERVER
public static final String UDP_SERVER
- See Also:
- Constant Field Values
-
-
Method Detail
-
eventTriggered
public void eventTriggered(HandlerContext ctx, Event event, CompletableFuture<Void> future)
Description copied from interface:Handler
Gets called if aEvent
was emitted.- Specified by:
eventTriggered
in interfaceHandler
- Overrides:
eventTriggered
in classHandlerAdapter
- Parameters:
ctx
- handler contextevent
- the eventfuture
- a future for the message
-
matchedWrite
protected void matchedWrite(HandlerContext ctx, InetSocketAddressWrapper recipient, AddressedByteBuf addressedByteBuf, CompletableFuture<Void> future)
Description copied from class:SimpleOutboundHandler
Is called for each message of typeSimpleOutboundHandler
.- Specified by:
matchedWrite
in classSimpleOutboundHandler<AddressedByteBuf,InetSocketAddressWrapper>
- Parameters:
ctx
- handler contextrecipient
- the recipient of the messageaddressedByteBuf
- the messagefuture
- a future for the message
-
-