Java Code Examples for com.alibaba.dubbo.remoting.Channel#close()

The following examples show how to use com.alibaba.dubbo.remoting.Channel#close() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractServer.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Override
public void connected(Channel ch) throws RemotingException {
    // If the server has entered the shutdown process, reject any new connection
    if (this.isClosing() || this.isClosed()) {
        logger.warn("Close new channel " + ch + ", cause: server is closing or has been closed. For example, receive a new connect request while in shutdown process.");
        ch.close();
        return;
    }

    Collection<Channel> channels = getChannels();
    if (accepts > 0 && channels.size() > accepts) {
        logger.error("Close channel " + ch + ", cause: The server " + ch.getLocalAddress() + " connections greater than max config " + accepts);
        ch.close();
        return;
    }
    super.connected(ch);
}
 
Example 2
Source File: AbstractServer.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Override
public void connected(Channel ch) throws RemotingException {
    Collection<Channel> channels = getChannels();
    if (accepts > 0 && channels.size() > accepts) {
        logger.error("Close channel " + ch + ", cause: The server " + ch.getLocalAddress() + " connections greater than max config " + accepts);
        ch.close();
        return;
    }
    super.connected(ch);
}
 
Example 3
Source File: AbstractServer.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
@Override
public void connected(Channel ch) throws RemotingException {
    Collection<Channel> channels = getChannels();
    if (accepts > 0 && channels.size() > accepts) {
        logger.error("Close channel " + ch + ", cause: The server " + ch.getLocalAddress() + " connections greater than max config " + accepts);
        ch.close();
        return;
    }
    super.connected(ch);
}
 
Example 4
Source File: AbstractServer.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
@Override
public void connected(Channel ch) throws RemotingException {
    Collection<Channel> channels = getChannels();
    if (accepts > 0 && channels.size() > accepts) {
        logger.error("Close channel " + ch + ", cause: The server " + ch.getLocalAddress() + " connections greater than max config " + accepts);
        ch.close();
        return;
    }
    super.connected(ch);
}
 
Example 5
Source File: AbstractServer.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Override
public void connected(Channel ch) throws RemotingException {
    Collection<Channel> channels = getChannels();
    if (accepts > 0 && channels.size() > accepts) {
        logger.error("Close channel " + ch + ", cause: The server " + ch.getLocalAddress() + " connections greater than max config " + accepts);
        ch.close();
        return;
    }
    super.connected(ch);
}
 
Example 6
Source File: AbstractServer.java    From dubbox with Apache License 2.0 5 votes vote down vote up
@Override
public void connected(Channel ch) throws RemotingException {
    Collection<Channel> channels = getChannels();
    if (accepts > 0 && channels.size() > accepts) {
        logger.error("Close channel " + ch + ", cause: The server " + ch.getLocalAddress() + " connections greater than max config " + accepts);
        ch.close();
        return;
    }
    super.connected(ch);
}
 
Example 7
Source File: ExitTelnetHandler.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
@Override
public String telnet(Channel channel, String message) {
    channel.close();
    return null;
}
 
Example 8
Source File: ExitTelnetHandler.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public String telnet(Channel channel, String message) {
    channel.close();
    return null;
}
 
Example 9
Source File: ExitTelnetHandler.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
public String telnet(Channel channel, String message) {
    channel.close();
    return null;
}
 
Example 10
Source File: ExitTelnetHandler.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public String telnet(Channel channel, String message) {
    channel.close();
    return null;
}
 
Example 11
Source File: ExitTelnetHandler.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public String telnet(Channel channel, String message) {
    channel.close();
    return null;
}
 
Example 12
Source File: ExitTelnetHandler.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public String telnet(Channel channel, String message) {
    channel.close();
    return null;
}