java.lang.Object
stincmale.server.AbstractServer
stincmale.server.netty4.NettyServer
- All Implemented Interfaces:
Server
@ThreadSafe public class NettyServer extends AbstractServer
-
Constructor Summary
Constructors Constructor Description NettyServer(ServerBootstrap sBootstrap)
-
Method Summary
Modifier and Type Method Description protected void
doStart(CompletableFuture<Void> futureStop)
This method is called fromAbstractServer.start()
only when it is required, so it does not need to care if the server was already started/stopped.protected void
doStop(CompletableFuture<Void> futureStop)
This method is called fromAbstractServer.stop()
only when it is required, so it does not need to care if the server was already started/stopped.static ServerBootstrap
newDefaultSBootstrap()
Creates a defaultServerBootstrap
.String
toString()
-
Constructor Details
-
NettyServer
- Parameters:
sBootstrap
- Should be used to specify server options as well as the address to listen.
-
-
Method Details
-
doStart
Description copied from class:AbstractServer
This method is called fromAbstractServer.start()
only when it is required, so it does not need to care if the server was already started/stopped.- Specified by:
doStart
in classAbstractServer
- Parameters:
futureStop
- The sameCompletableFuture
methodAbstractServer.start()
returns.
-
doStop
Description copied from class:AbstractServer
This method is called fromAbstractServer.stop()
only when it is required, so it does not need to care if the server was already started/stopped.- Specified by:
doStop
in classAbstractServer
- Parameters:
futureStop
- The sameCompletableFuture
methodAbstractServer.start()
returns.
-
toString
-
newDefaultSBootstrap
Creates a defaultServerBootstrap
.Server (parent) channel options:
ChannelOption.TCP_NODELAY
trueChannelOption.SO_REUSEADDR
trueChannelOption.SO_BACKLOG
50ChannelOption.ALLOCATOR
UnpooledByteBufAllocator.DEFAULT
ChannelOption.WRITE_BUFFER_WATER_MARK
WriteBufferWaterMark.DEFAULT
ChannelOption.ALLOCATOR
UnpooledByteBufAllocator.DEFAULT
PooledByteBufAllocator
, you have to releaseByteBuf
objects in your code.DispatchMonoHandler
releases request after response was sent.
-