java.nio.channels.AlreadyBoundException源码实例Demo

类java.nio.channels.AlreadyBoundException源码实例Demo

下面列出了java.nio.channels.AlreadyBoundException 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Bytecoder   文件: DatagramChannelImpl.java
@Override
public DatagramChannel bind(SocketAddress local) throws IOException {
    readLock.lock();
    try {
        writeLock.lock();
        try {
            synchronized (stateLock) {
                ensureOpen();
                if (localAddress != null)
                    throw new AlreadyBoundException();
                bindInternal(local);
            }
        } finally {
            writeLock.unlock();
        }
    } finally {
        readLock.unlock();
    }
    return this;
}
 
源代码2 项目: Bytecoder   文件: ServerSocketChannelImpl.java
@Override
public ServerSocketChannel bind(SocketAddress local, int backlog) throws IOException {
    synchronized (stateLock) {
        ensureOpen();
        if (localAddress != null)
            throw new AlreadyBoundException();
        InetSocketAddress isa = (local == null)
                                ? new InetSocketAddress(0)
                                : Net.checkAddress(local);
        SecurityManager sm = System.getSecurityManager();
        if (sm != null)
            sm.checkListen(isa.getPort());
        NetHooks.beforeTcpBind(fd, isa.getAddress(), isa.getPort());
        Net.bind(fd, isa.getAddress(), isa.getPort());
        Net.listen(fd, backlog < 1 ? 50 : backlog);
        localAddress = Net.localAddress(fd);
    }
    return this;
}
 
源代码3 项目: Bytecoder   文件: SocketChannelImpl.java
@Override
public SocketChannel bind(SocketAddress local) throws IOException {
    readLock.lock();
    try {
        writeLock.lock();
        try {
            synchronized (stateLock) {
                ensureOpen();
                if (state == ST_CONNECTIONPENDING)
                    throw new ConnectionPendingException();
                if (localAddress != null)
                    throw new AlreadyBoundException();
                InetSocketAddress isa = (local == null) ?
                    new InetSocketAddress(0) : Net.checkAddress(local);
                SecurityManager sm = System.getSecurityManager();
                if (sm != null) {
                    sm.checkListen(isa.getPort());
                }
                NetHooks.beforeTcpBind(fd, isa.getAddress(), isa.getPort());
                Net.bind(fd, isa.getAddress(), isa.getPort());
                localAddress = Net.localAddress(fd);
            }
        } finally {
            writeLock.unlock();
        }
    } finally {
        readLock.unlock();
    }
    return this;
}
 
源代码4 项目: dragonwell8_jdk   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码5 项目: TencentKona-8   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码6 项目: jdk8u60   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码7 项目: openjdk-jdk8u   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码8 项目: openjdk-jdk8u-backup   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码9 项目: openjdk-jdk9   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码10 项目: jdk8u-jdk   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码11 项目: hottub   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码12 项目: openjdk-8-source   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码13 项目: openjdk-8   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码14 项目: jdk8u_jdk   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码15 项目: jdk8u-jdk   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码16 项目: jdk8u-dev-jdk   文件: SctpNet.java
static boolean throwAlreadyBoundException() throws IOException {
    throw new AlreadyBoundException();
}
 
源代码评论
动弹
沙发等你来抢
 类所在包
 同包方法