本文整理汇总了Java中com.sun.nio.sctp.SctpStandardSocketOptions类的典型用法代码示例。如果您正苦于以下问题:Java SctpStandardSocketOptions类的具体用法?Java SctpStandardSocketOptions怎么用?Java SctpStandardSocketOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SctpStandardSocketOptions类属于com.sun.nio.sctp包,在下文中一共展示了SctpStandardSocketOptions类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setOption
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public <T> boolean setOption(ChannelOption<T> option, T value) {
validate(option, value);
if (option == SO_RCVBUF) {
setReceiveBufferSize((Integer) value);
} else if (option == SO_SNDBUF) {
setSendBufferSize((Integer) value);
} else if (option == SCTP_NODELAY) {
setSctpNoDelay((Boolean) value);
} else if (option == SCTP_INIT_MAXSTREAMS) {
setInitMaxStreams((SctpStandardSocketOptions.InitMaxStreams) value);
} else {
return super.setOption(option, value);
}
return true;
}
示例2: isSctpNoDelay
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public boolean isSctpNoDelay() {
try {
return javaChannel.getOption(SctpStandardSocketOptions.SCTP_NODELAY);
} catch (IOException e) {
throw new ChannelException(e);
}
}
示例3: setSctpNoDelay
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public SctpChannelConfig setSctpNoDelay(boolean sctpNoDelay) {
try {
javaChannel.setOption(SctpStandardSocketOptions.SCTP_NODELAY, sctpNoDelay);
} catch (IOException e) {
throw new ChannelException(e);
}
return this;
}
示例4: getSendBufferSize
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public int getSendBufferSize() {
try {
return javaChannel.getOption(SctpStandardSocketOptions.SO_SNDBUF);
} catch (IOException e) {
throw new ChannelException(e);
}
}
示例5: setSendBufferSize
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public SctpChannelConfig setSendBufferSize(int sendBufferSize) {
try {
javaChannel.setOption(SctpStandardSocketOptions.SO_SNDBUF, sendBufferSize);
} catch (IOException e) {
throw new ChannelException(e);
}
return this;
}
示例6: getReceiveBufferSize
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public int getReceiveBufferSize() {
try {
return javaChannel.getOption(SctpStandardSocketOptions.SO_RCVBUF);
} catch (IOException e) {
throw new ChannelException(e);
}
}
示例7: setReceiveBufferSize
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public SctpChannelConfig setReceiveBufferSize(int receiveBufferSize) {
try {
javaChannel.setOption(SctpStandardSocketOptions.SO_RCVBUF, receiveBufferSize);
} catch (IOException e) {
throw new ChannelException(e);
}
return this;
}
示例8: getInitMaxStreams
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public SctpStandardSocketOptions.InitMaxStreams getInitMaxStreams() {
try {
return javaChannel.getOption(SctpStandardSocketOptions.SCTP_INIT_MAXSTREAMS);
} catch (IOException e) {
throw new ChannelException(e);
}
}
示例9: setInitMaxStreams
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public SctpChannelConfig setInitMaxStreams(SctpStandardSocketOptions.InitMaxStreams initMaxStreams) {
try {
javaChannel.setOption(SctpStandardSocketOptions.SCTP_INIT_MAXSTREAMS, initMaxStreams);
} catch (IOException e) {
throw new ChannelException(e);
}
return this;
}
示例10: setSendBufferSize
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public SctpServerChannelConfig setSendBufferSize(int sendBufferSize) {
try {
javaChannel.setOption(SctpStandardSocketOptions.SO_SNDBUF, sendBufferSize);
} catch (IOException e) {
throw new ChannelException(e);
}
return this;
}
示例11: setReceiveBufferSize
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public SctpServerChannelConfig setReceiveBufferSize(int receiveBufferSize) {
try {
javaChannel.setOption(SctpStandardSocketOptions.SO_RCVBUF, receiveBufferSize);
} catch (IOException e) {
throw new ChannelException(e);
}
return this;
}
示例12: getInitMaxStreams
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public InitMaxStreams getInitMaxStreams() {
try {
return javaChannel.getOption(SctpStandardSocketOptions.SCTP_INIT_MAXSTREAMS);
} catch (IOException e) {
throw new ChannelException(e);
}
}
示例13: setInitMaxStreams
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
@Override
public SctpServerChannelConfig setInitMaxStreams(InitMaxStreams initMaxStreams) {
try {
javaChannel.setOption(SctpStandardSocketOptions.SCTP_INIT_MAXSTREAMS, initMaxStreams);
} catch (IOException e) {
throw new ChannelException(e);
}
return this;
}
示例14: defaultOptions
import com.sun.nio.sctp.SctpStandardSocketOptions; //导入依赖的package包/类
private static Set<SctpSocketOption<?>> defaultOptions() {
HashSet<SctpSocketOption<?>> set = new HashSet<SctpSocketOption<?>>(1);
set.add(SctpStandardSocketOptions.SCTP_INIT_MAXSTREAMS);
return Collections.unmodifiableSet(set);
}