2525import io .netty .channel .Channel ;
2626import io .netty .channel .ChannelFuture ;
2727import io .netty .channel .ChannelFutureListener ;
28+ import io .netty .channel .ChannelHandler ;
2829import io .netty .channel .ChannelHandlerContext ;
2930import io .netty .channel .ChannelInitializer ;
3031import io .netty .channel .ChannelOption ;
@@ -310,11 +311,11 @@ private void createServerBootstrap(String name, Settings settings) {
310311 serverBootstraps .put (name , serverBootstrap );
311312 }
312313
313- protected ChannelInitializer < SocketChannel > getServerChannelInitializer (String name , Settings settings ) {
314+ protected ChannelHandler getServerChannelInitializer (String name , Settings settings ) {
314315 return new ServerChannelInitializer (name , settings );
315316 }
316317
317- protected ChannelInitializer < SocketChannel > getClientChannelInitializer () {
318+ protected ChannelHandler getClientChannelInitializer () {
318319 return new ClientChannelInitializer ();
319320 }
320321
@@ -506,18 +507,18 @@ protected void stopInternal() {
506507 });
507508 }
508509
509- protected class ClientChannelInitializer extends ChannelInitializer <SocketChannel > {
510+ protected class ClientChannelInitializer extends ChannelInitializer <Channel > {
510511
511512 @ Override
512- protected void initChannel (SocketChannel ch ) throws Exception {
513+ protected void initChannel (Channel ch ) throws Exception {
513514 ch .pipeline ().addLast ("size" , new Netty4SizeHeaderFrameDecoder ());
514515 // using a dot as a prefix means this cannot come from any settings parsed
515516 ch .pipeline ().addLast ("dispatcher" , new Netty4MessageChannelHandler (Netty4Transport .this , ".client" ));
516517 }
517518
518519 }
519520
520- protected class ServerChannelInitializer extends ChannelInitializer <SocketChannel > {
521+ protected class ServerChannelInitializer extends ChannelInitializer <Channel > {
521522
522523 protected final String name ;
523524 protected final Settings settings ;
@@ -528,10 +529,11 @@ protected ServerChannelInitializer(String name, Settings settings) {
528529 }
529530
530531 @ Override
531- protected void initChannel (SocketChannel ch ) throws Exception {
532+ protected void initChannel (Channel ch ) throws Exception {
532533 ch .pipeline ().addLast ("open_channels" , Netty4Transport .this .serverOpenChannels );
533534 ch .pipeline ().addLast ("size" , new Netty4SizeHeaderFrameDecoder ());
534535 ch .pipeline ().addLast ("dispatcher" , new Netty4MessageChannelHandler (Netty4Transport .this , name ));
535536 }
536537 }
538+
537539}
0 commit comments