org.zodiac.sdk.simplenetty.channel.Channel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zodiac-sdk-nio Show documentation
Show all versions of zodiac-sdk-nio Show documentation
Zodiac SDK NIO2(New Non-Blocking IO)
package org.zodiac.sdk.simplenetty.channel;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.spi.AbstractSelectableChannel;
import org.zodiac.sdk.simplenetty.concurrent.ChannelFuture;
import org.zodiac.sdk.simplenetty.concurrent.ChannelPromise;
import org.zodiac.sdk.simplenetty.core.EventLoop;
import org.zodiac.sdk.simplenetty.handler.ChannelPipeline;
public interface Channel {
AbstractSelectableChannel javaChannel();
EventLoop eventLoop();
boolean isOpen();
boolean isRegistered();
boolean isActive();
SocketAddress localAddress();
SocketAddress remoteAddress();
ChannelFuture closeFuture();
Channel.Unsafe unsafe();
ChannelPipeline pipeline();
public interface Unsafe {
SocketAddress localAddress();
SocketAddress remoteAddress();
void bind(SocketAddress address, ChannelPromise promise);
void connect(SocketAddress address, ChannelPromise promise);
// void disconnect(ChannelPromise promise);
//
// void close(ChannelPromise promise);
//
// void closeForcibly();
//
// void deregister(ChannelPromise promise);
//
// void beginRead();
void write(ByteBuffer buffer);
void flush();
}
}