原创 CentOS6.8Minimal安裝Gnome桌面並安裝Tigervnc進行遠程管理

一、給Centos6.8Minimal安裝桌面環境 @1、安裝桌面軟件 yum groupinstall "Desktop" @2、安裝X-Window組件 yum groupinstall "X Window System" @3、安裝

原创 Netty-源碼分析WebSocketClient客戶端

WebSocketClient客戶端使用Netty實現的源碼分析 EventLoopGroup workerGroup = new NioEventLoopGroup(); try { Boots

原创 Netty-源碼分析LineBasedFrameDecoder

LineBasedFrameDecoder源碼分析 package io.netty.handler.codec; import io.netty.buffer.ByteBuf; import io.netty.channel.Ch

原创 Netty-源碼分析ByteBuf-slice和retainedSlice使用細節

Netty-源碼分析ByteBuf-slice和retainedSlice使用細節 slice() = slice(buf.readerIndex(), buf.readableBytes()) 源碼片段,返回原始ByteBuf可讀字節

原创 JAVA中的時區設置

JAVA中的時區設置 第一種方式、通過代碼指定。 final TimeZone timeZone = TimeZone.getTimeZone("GTM+8"); TimeZone.setDefault(timeZone);   第二種

原创 Netty源碼分析-內存模型PoolSubpage

    PoolSubpage源碼分析-這個方法獲取一個long表示的64個比特位置是否還有空餘空間 private int findNextAvail() { // 沒有明確的可用位置時則挨個查找

原创 Netty源碼分析-Unsafe

Unsafe是JAVA提供偏底層的一個工具類,提供堆外內存管理,CAS操作,線程調度等功能。   Unsafe這個類不能直接獲取,需要用反射獲取其對象。 //反射拿到Unsafe對象 private static Uns

原创 Netty使用技巧-使用Openssl加密傳輸

JDK原生使用數字證書和PKCS#8格式的私鑰完成SSL引擎的初始化。   #使用JDK的SslEngine引擎初始化SslContent File certChainFile=new File("/home/certs/nginx.c

原创 Netty源碼分析-PlatformDependent內存管理

  PlatformDependent類當中的常量,定義了允許使用的堆外內存最大值,該值可以通過-XX:MaxDirectMemorySize=2G設置。 private static final long MAX_DIRECT_MEM

原创 Netty源碼分析-ProtobufEncoder-Decoder

ProtobufEncoder源碼分析 @Sharable public class ProtobufEncoder extends MessageToMessageEncoder<MessageLiteOrBuilder> {

原创 Netty源碼分析-ProtobufVarint32FrameDecoder

    package io.netty.handler.codec.protobuf; import com.google.protobuf.CodedInputStream; import com.google.protobuf

原创 Netty源碼分析-ProtobufVarint32LengthFieldPrepender

ProtobufVarint32LengthFieldPrepender源碼分析   package io.netty.handler.codec.protobuf; import com.google.protobuf.CodedO

原创 Netty源碼分析-WebSocketServerProtocolHandler

WebSocketServerProtocolHandler源碼分析   package io.netty.handler.codec.http.websocketx; import io.netty.buffer.Unpooled

原创 Netty源碼分析-WebSocketProtocolHandler

WebSocketProtocolHandler源碼分析 package io.netty.handler.codec.http.websocketx; import io.netty.channel.ChannelHandlerC

原创 Netty源碼分析-WebSocketServerProtocolHandshakeHandler

WebSocketServerProtocolHandshakeHandler源碼分析   class WebSocketServerProtocolHandshakeHandler extends ChannelInboundHand