- 博客(5)
- 收藏
- 关注
原创 深入理解IdleStateHandler ,ReadTimeoutHandler,WriteTimeoutHandler
Netty 提供了 IdleStateHandler ,ReadTimeoutHandler,WriteTimeoutHandler 三个 Handler 检测连接的有效性。IdleStateHandler 可以实现心跳功能,当服务器和客户端没有任何读写交互时,并超过了给定的时间,则会触发用户 handler 的 userEventTriggered 方法。ReadTimeoutHandler事件则是当服务器和客户端没有任何读写交互时,并超过了给定的时间,则会直接抛出异常并且断开通道的连接。Write
2022-06-09 08:55:40 804
原创 为什么hashmap扩容要是原来的两倍?
为什么hashmap扩容要是原来的两倍?1. 为什么首先说为什么,扩容为2的n次幂是为了降低hash冲突。2. 原因源码hashmap调用put方法放入元素时会在下面代码第6行进行一个(n-1)&hash的算法,具体如下:final V putVal(int hash, K key, V value, boolean onlyIfAbsent, boolean evict) { Node<K,V>[] tab; Node&l
2022-05-08 13:20:56 628
原创 ERROR: In file ‘./docker-compose.yml‘, the service name True must be a quoted string, i.e. ‘True‘.
ERROR: In file './docker-compose.yml', the service name True must be a quoted string, i.e. 'True'.
2021-12-27 19:05:44 2289
原创 yml文件注释报错,Failed to load property source from location ‘classpath:/application.yml‘
Failed to load property source from location 'classpath:/application.yml'
2021-12-24 20:27:33 305
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人