• 大小: 573KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-06
  • 语言: 其他
  • 标签: Netty  

资源简介

《Netty 实战》源码,用于Netty的学习和参考!

资源截图

代码片段和文件信息

package nia.chapter1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by kerr.
 *
 * 代码清单 1-1 阻塞 I/O 示例
 */
public class BlockingIoExample {

    /**
     * 代码清单 1-1 阻塞 I/O 示例
     * */
    public void serve(int portNumber) throws IOException {
        //创建一个新的 ServerSocket,用以监听指定端口上的连接请求
        ServerSocket serverSocket = new ServerSocket(portNumber);
        //对accept()方法的调用将被阻塞,直到一个连接建立
        Socket clientSocket = serverSocket.accept();
        //这些流对象都派生于该套接字的流对象
        BufferedReader in = new BufferedReader(
                new InputStreamReader(clientSocket.getInputStream()));
        PrintWriter out =
                new PrintWriter(clie

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-17 11:38  netty-in-action\
     目录           0  2019-04-24 09:07  netty-in-action\chapter8\
     目录           0  2019-04-24 09:07  netty-in-action\chapter8\target\
     目录           0  2019-04-24 09:07  netty-in-action\chapter8\target\generated-sources\
     目录           0  2019-04-24 09:07  netty-in-action\chapter8\target\generated-sources\annotations\
     目录           0  2019-04-24 09:07  netty-in-action\chapter8\target\classes\
     目录           0  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\
     目录           0  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\
     文件        1437  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapSharingEventLoopGroup$1$1.class
     文件        1475  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapServer.class
     文件        1827  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\GracefulShutdown.class
     文件        1345  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapServer$2.class
     文件        1605  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\InvalidBootstrapClient.class
     文件        1450  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapDatagramChannel.class
     文件        1494  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapWithInitializer.class
     文件        1308  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\GracefulShutdown$1.class
     文件        1546  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapSharingEventLoopGroup.class
     文件        1344  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\InvalidBootstrapClient$1.class
     文件        1400  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapDatagramChannel$2.class
     文件        1361  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapClient$2.class
     文件        2491  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapSharingEventLoopGroup$1.class
     文件        2017  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapClientWithOptionsAndAttrs$1.class
     文件        1302  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapServer$1.class
     文件        1420  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapWithInitializer$ChannelInitializerImpl.class
     文件        1667  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapClient.class
     文件        1435  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapSharingEventLoopGroup$2.class
     文件        1302  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapClient$1.class
     文件        2266  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapClientWithOptionsAndAttrs.class
     文件        1232  2019-04-24 09:07  netty-in-action\chapter8\target\classes\nia\chapter8\BootstrapDatagramChannel$1.class
     目录           0  2019-04-24 09:07  netty-in-action\chapter8\target\maven-status\
     目录           0  2019-04-24 09:07  netty-in-action\chapter8\target\maven-status\maven-compiler-plugin\
............此处省略881个文件信息

评论

共有 条评论