ExtendedSocketOptions.java 文件源码

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

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

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

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


问题


面经


文章

微信
公众号

扫码关注公众号