File tree Expand file tree Collapse file tree
game-core/src/test/java/com/snowcattle/game/net/client/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public static void main(String[] args) throws Exception {
5858 Bootstrap b = new Bootstrap ();
5959 b .group (group )
6060 .channel (NioSocketChannel .class )
61- .handler (new HttpSnoopClientInitializer (sslCtx ));
61+ .handler (new GameHttpClientInitializer (sslCtx ));
6262
6363 // Make the connection attempt.
6464 Channel ch = b .connect (host , port ).sync ().channel ();
Original file line number Diff line number Diff line change 1515 * Created by jiangwenping on 2017/9/29.
1616 */
1717
18- public class GameHttpClientHandler extends SimpleChannelInboundHandler <HttpObject > {
18+ public class GameHttpClientHandler extends SimpleChannelInboundHandler <Object > {
1919
2020 @ Override
21- public void channelRead0 (ChannelHandlerContext ctx , HttpObject msg ) {
21+ public void channelRead0 (ChannelHandlerContext ctx , Object msg ) {
2222 if (msg instanceof HttpResponse ) {
2323 HttpResponse response = (HttpResponse ) msg ;
2424
Original file line number Diff line number Diff line change @@ -35,9 +35,9 @@ public void initChannel(SocketChannel ch) {
3535 // Uncomment the following line if you don't want to handle HttpContents.
3636 //p.addLast(new HttpObjectAggregator(1048576));
3737
38- p .addLast ("encoder" , new HttpResponseEncoder ());
38+ p .addLast ("encoder" , new HttpRequestEncoder ());
3939// p.addLast("trunk", new HttpObjectAggregator(1048576));
40- p .addLast ("decoder" , new HttpRequestDecoder ());
40+ p .addLast ("decoder" , new HttpResponseDecoder ());
4141
4242 p .addLast (new GameHttpClientHandler ());
4343 }
You can’t perform that action at this time.
0 commit comments