On Mon, 2018-07-16 at 16:41 -0600, Gary Gregory wrote:
> Hi All:
> 
> When I configure sockets for a ServerBootstrap I have to use a
> SocketConfig:
> 
>         final SocketConfig socketConfig = SocketConfig.custom()
>                 .setSoTimeout(Timeout.ofSeconds(15))
>                 .setTcpNoDelay(true)
>                 .build();
> 
>         server = ServerBootstrap.bootstrap()
>                 .setListenerPort(port)
>                 .setSocketConfig(socketConfig)
> 
> .setHttpProcessor(HttpProcessors.server(NHttpFileServerTestRule.class
> .getCanonicalName()
> + "/1.1"))
>                 .register("*", new CustomHttpTestHandler())
>                 .setExceptionListener(ExceptionListener.STD_ERR)
>                 .create();
> 
> But when I configure sockets in an AsyncServerBootstrap, I have to
> use an
> IOReactorConfig:
> 
>         IOReactorConfig config =
> IOReactorConfig.custom().setSoTimeout(15,
> TimeUnit.SECONDS).setTcpNoDelay(true).build();
> 
>         server = AsyncServerBootstrap.bootstrap()
>                 .setIOReactorConfig(config)
>                 .register("*", new
> AsyncServerRequestHandler<Message<HttpRequest, Void>>() {
> 
> This is confusing, I should be able to use the same kind of object in
> both
> places.
> 

I doubt this is realistic. Differences between SocketConfig and
IOReactorConfig simply reflect the differences between the classic
(blocking) and non-blocking i/o models.

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to