当前位置: 首页>>代码示例>>Java>>正文


Java ResourceManager.afterUdpClose方法代码示例

本文整理汇总了Java中sun.net.ResourceManager.afterUdpClose方法的典型用法代码示例。如果您正苦于以下问题:Java ResourceManager.afterUdpClose方法的具体用法?Java ResourceManager.afterUdpClose怎么用?Java ResourceManager.afterUdpClose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.net.ResourceManager的用法示例。


在下文中一共展示了ResourceManager.afterUdpClose方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: implCloseSelectableChannel

import sun.net.ResourceManager; //导入方法依赖的package包/类
protected void implCloseSelectableChannel() throws IOException {
    synchronized (stateLock) {
        if (state != ST_KILLED)
            nd.preClose(fd);
        ResourceManager.afterUdpClose();

        // if member of mulitcast group then invalidate all keys
        if (registry != null)
            registry.invalidateAll();

        long th;
        if ((th = readerThread) != 0)
            NativeThread.signal(th);
        if ((th = writerThread) != 0)
            NativeThread.signal(th);
        if (!isRegistered())
            kill();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:DatagramChannelImpl.java

示例2: DatagramChannelImpl

import sun.net.ResourceManager; //导入方法依赖的package包/类
public DatagramChannelImpl(SelectorProvider sp)
    throws IOException
{
    super(sp);
    ResourceManager.beforeUdpCreate();
    try {
        this.family = Net.isIPv6Available() ?
            StandardProtocolFamily.INET6 : StandardProtocolFamily.INET;
        this.fd = Net.socket(family, false);
        this.fdVal = IOUtil.fdVal(fd);
        this.state = ST_UNCONNECTED;
    } catch (IOException ioe) {
        ResourceManager.afterUdpClose();
        throw ioe;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:DatagramChannelImpl.java

示例3: create

import sun.net.ResourceManager; //导入方法依赖的package包/类
/**
 * Creates a socket with a boolean that specifies whether this
 * is a stream socket (true) or an unconnected UDP socket (false).
 */
protected synchronized void create(boolean stream) throws IOException {
    this.stream = stream;
    if (!stream) {
        ResourceManager.beforeUdpCreate();
        // only create the fd after we know we will be able to create the socket
        fd = new FileDescriptor();
        try {
            socketCreate(false);
        } catch (IOException ioe) {
            ResourceManager.afterUdpClose();
            fd = null;
            throw ioe;
        }
    } else {
        fd = new FileDescriptor();
        socketCreate(true);
    }
    if (socket != null)
        socket.setCreated();
    if (serverSocket != null)
        serverSocket.setCreated();
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:27,代码来源:AbstractPlainSocketImpl.java

示例4: create

import sun.net.ResourceManager; //导入方法依赖的package包/类
/**
 * Creates a socket with a boolean that specifies whether this
 * is a stream socket (true) or an unconnected UDP socket (false).
 */
protected synchronized void create(boolean stream) throws IOException {
    fd = new FileDescriptor();
    this.stream = stream;
    if (!stream) {
        ResourceManager.beforeUdpCreate();
        try {
            socketCreate(false);
        } catch (IOException ioe) {
            ResourceManager.afterUdpClose();
            fd = null;
            throw ioe;
        }
    } else {
        socketCreate(true);
    }
    if (socket != null)
        socket.setCreated();
    if (serverSocket != null)
        serverSocket.setCreated();
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:25,代码来源:AbstractPlainSocketImpl.java

示例5: close

import sun.net.ResourceManager; //导入方法依赖的package包/类
protected void close() {
    if (fd != null || fd1 != null) {
        datagramSocketClose();
        ResourceManager.afterUdpClose();
        fd = null;
        fd1 = null;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:TwoStacksPlainDatagramSocketImpl.java

示例6: close

import sun.net.ResourceManager; //导入方法依赖的package包/类
/**
 * Closes the socket.
 */
@Override
protected void close() throws IOException {
    synchronized(fdLock) {
        if (fd != null || fd1 != null) {
            if (!stream) {
                ResourceManager.afterUdpClose();
            }
            if (fdUseCount == 0) {
                if (closePending) {
                    return;
                }
                closePending = true;
                socketClose();
                fd = null;
                fd1 = null;
                return;
            } else {
                /*
                 * If a thread has acquired the fd and a close
                 * isn't pending then use a deferred close.
                 * Also decrement fdUseCount to signal the last
                 * thread that releases the fd to close it.
                 */
                if (!closePending) {
                    closePending = true;
                    fdUseCount--;
                    socketClose();
                }
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:TwoStacksPlainSocketImpl.java

示例7: create

import sun.net.ResourceManager; //导入方法依赖的package包/类
/**
 * Creates a datagram socket
 */
protected synchronized void create() throws SocketException {
    ResourceManager.beforeUdpCreate();
    fd = new FileDescriptor();
    try {
        datagramSocketCreate();
    } catch (SocketException ioe) {
        ResourceManager.afterUdpClose();
        fd = null;
        throw ioe;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:AbstractPlainDatagramSocketImpl.java

示例8: close

import sun.net.ResourceManager; //导入方法依赖的package包/类
/**
 * Close the socket.
 */
protected void close() {
    if (fd != null) {
        datagramSocketClose();
        ResourceManager.afterUdpClose();
        fd = null;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:AbstractPlainDatagramSocketImpl.java

示例9: create

import sun.net.ResourceManager; //导入方法依赖的package包/类
/**
 * Creates a datagram socket
 */
protected synchronized void create() throws SocketException {
    fd = new FileDescriptor();
    ResourceManager.beforeUdpCreate();
    try {
        datagramSocketCreate();
    } catch (SocketException ioe) {
        ResourceManager.afterUdpClose();
        fd = null;
        throw ioe;
    }
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:15,代码来源:AbstractPlainDatagramSocketImpl.java

示例10: close

import sun.net.ResourceManager; //导入方法依赖的package包/类
/**
 * Closes the socket.
 */
protected void close() throws IOException {
    synchronized(fdLock) {
        if (fd != null) {
            if (!stream) {
                ResourceManager.afterUdpClose();
            }
            if (fdUseCount == 0) {
                if (closePending) {
                    return;
                }
                closePending = true;
                /*
                 * We close the FileDescriptor in two-steps - first the
                 * "pre-close" which closes the socket but doesn't
                 * release the underlying file descriptor. This operation
                 * may be lengthy due to untransmitted data and a long
                 * linger interval. Once the pre-close is done we do the
                 * actual socket to release the fd.
                 */
                try {
                    socketPreClose();
                } finally {
                    socketClose();
                }
                fd = null;
                return;
            } else {
                /*
                 * If a thread has acquired the fd and a close
                 * isn't pending then use a deferred close.
                 * Also decrement fdUseCount to signal the last
                 * thread that releases the fd to close it.
                 */
                if (!closePending) {
                    closePending = true;
                    fdUseCount--;
                    socketPreClose();
                }
            }
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:AbstractPlainSocketImpl.java


注:本文中的sun.net.ResourceManager.afterUdpClose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。