ExtendedSocketOptions.java 文件源码

java
阅读 16 收藏 0 点赞 0 评论 0

项目:openjdk-jdk10 作者:
@Override
public void setOption(FileDescriptor fd,
                      SocketOption<?> option,
                      Object value)
    throws SocketException
{
    SecurityManager sm = System.getSecurityManager();
    if (sm != null)
        sm.checkPermission(new NetworkPermission("setOption." + option.name()));

    if (fd == null || !fd.valid())
        throw new SocketException("socket closed");

    if (option == SO_FLOW_SLA) {
        assert flowSupported;
        SocketFlow flow = checkValueType(value, option.type());
        setFlowOption(fd, flow);
    } else {
        throw new InternalError("Unexpected option " + option);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号