Citizens2/main/src/main/java/net/citizensnpcs/util/EmptyChannel.java

81 lines
1.6 KiB
Java
Raw Normal View History

2022-11-28 16:10:50 +01:00
package net.citizensnpcs.util;
2018-04-07 10:02:35 +02:00
2022-08-04 05:49:42 +02:00
import java.net.SocketAddress;
2018-04-07 10:02:35 +02:00
import io.netty.channel.AbstractChannel;
import io.netty.channel.Channel;
import io.netty.channel.ChannelConfig;
import io.netty.channel.ChannelMetadata;
import io.netty.channel.ChannelOutboundBuffer;
import io.netty.channel.DefaultChannelConfig;
import io.netty.channel.EventLoop;
public class EmptyChannel extends AbstractChannel {
private final ChannelConfig config = new DefaultChannelConfig(this);
public EmptyChannel(Channel parent) {
super(parent);
}
@Override
public ChannelConfig config() {
config.setAutoRead(true);
return config;
}
@Override
protected void doBeginRead() throws Exception {
}
@Override
protected void doBind(SocketAddress arg0) throws Exception {
}
@Override
protected void doClose() throws Exception {
}
@Override
protected void doDisconnect() throws Exception {
}
@Override
protected void doWrite(ChannelOutboundBuffer arg0) throws Exception {
}
@Override
public boolean isActive() {
return false;
}
@Override
protected boolean isCompatible(EventLoop arg0) {
2023-10-01 11:27:38 +02:00
return false;
2018-04-07 10:02:35 +02:00
}
@Override
public boolean isOpen() {
return false;
}
@Override
protected SocketAddress localAddress0() {
return null;
}
@Override
public ChannelMetadata metadata() {
return new ChannelMetadata(true);
2018-04-07 10:02:35 +02:00
}
@Override
protected AbstractUnsafe newUnsafe() {
return null;
}
@Override
protected SocketAddress remoteAddress0() {
return null;
}
}