上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页
摘要: Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators a 阅读全文
posted @ 2019-05-05 14:57 小白兔云 阅读(161) 评论(0) 推荐(0)
摘要: Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia:In a complete binary tree every lev 阅读全文
posted @ 2019-05-05 09:37 小白兔云 阅读(126) 评论(0) 推荐(0)
摘要: ChannelHandler的添加 一般用户会先添加ChannelInitializer这个Handler,通过这个handler获取channel对应的pipeline,将一系列的channelHandler添加到Pipeline上面。主要是通过调用pipeline的addLast方法进行添加。代 阅读全文
posted @ 2019-05-03 19:30 小白兔云 阅读(616) 评论(0) 推荐(0)
摘要: 不论是NioServerSocketChannel,还是NioSocketChannel,最终都会调用父类AbstractChannel的构造函数,pipeline也在channel被创建的时候被创建。 而这里是创建了一个DefaultChannelPipeline。构造函数会保存传入的channe 阅读全文
posted @ 2019-05-02 21:51 小白兔云 阅读(285) 评论(0) 推荐(0)
摘要: Netty服务端处理新连接的流程: 1.检测新连接 2.基于NioServerSocketChannel创建客户端的NioSocketChannel 3.分配客户端channel的线程,注册线程所对应的selector 4.向selector注册读事件 新连接检测 服务端在创建完服务端的NioSer 阅读全文
posted @ 2019-05-02 19:51 小白兔云 阅读(553) 评论(0) 推荐(0)
摘要: NioEventLoop启动触发条件: 1.服务端绑定本地端口 2.新连接接入通过chooser绑定一个NioEventLoop 服务端绑定本地端口 绑定本地端口,使用下面方法; 最终会调用doBind0()方法: 这个时候就会调用channel对应NioEventLoop的execute方法,会判 阅读全文
posted @ 2019-05-02 00:08 小白兔云 阅读(936) 评论(0) 推荐(0)
摘要: NioEventLoopGroup的创建 服务端一般是通过创建两个NioEventLoopGroup来创建NioEventLoop,一个NioEventLoopGroup主要是用于接收客户端的请求,另外一个NioEventLoopGroup则是处理网络IO的相关读写操作,或者是执行定时任务,或者是系 阅读全文
posted @ 2019-05-01 14:19 小白兔云 阅读(709) 评论(0) 推荐(0)
摘要: Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and 阅读全文
posted @ 2019-04-29 15:47 小白兔云 阅读(118) 评论(0) 推荐(0)
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: 题目大意: 求二维矩阵中正方形面积的最大值。 解法: 阅读全文
posted @ 2019-04-29 14:41 小白兔云 阅读(118) 评论(0) 推荐(0)
摘要: Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be 阅读全文
posted @ 2019-04-29 10:39 小白兔云 阅读(126) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 10 ··· 16 下一页