io.netty.util.internal.PlatformDependent#canEnableTcpNoDelayByDefault ( )源码实例Demo

下面列出了io.netty.util.internal.PlatformDependent#canEnableTcpNoDelayByDefault ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netty-4.1.22   文件: DefaultSocketChannelConfig.java
/**
 * Creates a new instance.
 */
public DefaultSocketChannelConfig(SocketChannel channel, Socket javaSocket) {
    super(channel);
    if (javaSocket == null) {
        throw new NullPointerException("javaSocket");
    }
    this.javaSocket = javaSocket;

    // Enable TCP_NODELAY by default if possible.
    if (PlatformDependent.canEnableTcpNoDelayByDefault()) {
        try {
            setTcpNoDelay(true);
        } catch (Exception e) {
            // Ignore.
        }
    }
}
 
源代码2 项目: netty-4.1.22   文件: DefaultSctpChannelConfig.java
public DefaultSctpChannelConfig(io.netty.channel.sctp.SctpChannel channel, SctpChannel javaChannel) {
    super(channel);
    if (javaChannel == null) {
        throw new NullPointerException("javaChannel");
    }
    this.javaChannel = javaChannel;

    // Enable TCP_NODELAY by default if possible.
    if (PlatformDependent.canEnableTcpNoDelayByDefault()) {
        try {
            setSctpNoDelay(true);
        } catch (Exception e) {
            // Ignore.
        }
    }
}
 
/**
 * Creates a new instance.
 */
public DefaultSocketChannelConfig(SocketChannel channel, Socket javaSocket) {
    super(channel);
    if (javaSocket == null) {
        throw new NullPointerException("javaSocket");
    }
    this.javaSocket = javaSocket;

    // Enable TCP_NODELAY by default if possible.
    if (PlatformDependent.canEnableTcpNoDelayByDefault()) {
        try {
            setTcpNoDelay(true);
        } catch (Exception e) {
            // Ignore.
        }
    }
}
 
public DefaultSctpChannelConfig(io.netty.channel.sctp.SctpChannel channel, SctpChannel javaChannel) {
    super(channel);
    if (javaChannel == null) {
        throw new NullPointerException("javaChannel");
    }
    this.javaChannel = javaChannel;

    // Enable TCP_NODELAY by default if possible.
    if (PlatformDependent.canEnableTcpNoDelayByDefault()) {
        try {
            setSctpNoDelay(true);
        } catch (Exception e) {
            // Ignore.
        }
    }
}
 
源代码5 项目: netty-4.1.22   文件: KQueueSocketChannelConfig.java
KQueueSocketChannelConfig(KQueueSocketChannel channel) {
    super(channel);
    this.channel = channel;
    if (PlatformDependent.canEnableTcpNoDelayByDefault()) {
        setTcpNoDelay(true);
    }
    calculateMaxBytesPerGatheringWrite();
}
 
源代码6 项目: netty-4.1.22   文件: EpollSocketChannelConfig.java
/**
 * Creates a new instance.
 */
EpollSocketChannelConfig(EpollSocketChannel channel) {
    super(channel);

    this.channel = channel;
    if (PlatformDependent.canEnableTcpNoDelayByDefault()) {
        setTcpNoDelay(true);
    }
    calculateMaxBytesPerGatheringWrite();
}
 
/**
 * Creates a new instance.
 */
EpollSocketChannelConfig(EpollSocketChannel channel) {
    super(channel);

    this.channel = channel;
    if (PlatformDependent.canEnableTcpNoDelayByDefault()) {
        setTcpNoDelay(true);
    }
}