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 voiddoStart(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 voiddoStop(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 ServerBootstrapnewDefaultSBootstrap()Creates a defaultServerBootstrap.StringtoString()
-
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:AbstractServerThis 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:
doStartin classAbstractServer- Parameters:
futureStop- The sameCompletableFuturemethodAbstractServer.start()returns.
-
doStop
Description copied from class:AbstractServerThis 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:
doStopin classAbstractServer- Parameters:
futureStop- The sameCompletableFuturemethodAbstractServer.start()returns.
-
toString
-
newDefaultSBootstrap
Creates a defaultServerBootstrap.Server (parent) channel options:
ChannelOption.TCP_NODELAYtrueChannelOption.SO_REUSEADDRtrueChannelOption.SO_BACKLOG50ChannelOption.ALLOCATORUnpooledByteBufAllocator.DEFAULT
ChannelOption.WRITE_BUFFER_WATER_MARKWriteBufferWaterMark.DEFAULTChannelOption.ALLOCATORUnpooledByteBufAllocator.DEFAULT
PooledByteBufAllocator, you have to releaseByteBufobjects in your code.DispatchMonoHandlerreleases request after response was sent.
-