use of com.generallycloud.baseio.protocol.DefaultChannelFuture in project baseio by generallycloud.
the class AbstractSocketChannel method fireOpend.
@Override
public void fireOpend() {
SocketChannelContext context = getContext();
if (context.isEnableSSL()) {
InetSocketAddress remote = getRemoteSocketAddress();
this.sslHandler = getSocketChannelThreadContext().getSslHandler();
this.sslEngine = context.getSslContext().newEngine(remote.getHostName(), remote.getPort());
}
if (isEnableSSL() && context.getSslContext().isClient()) {
doFlush(new DefaultChannelFuture(getContext(), EmptyByteBuf.getInstance()));
}
UnsafeSocketSession session = getSession();
if (!session.isClosed()) {
threadContext.getSocketSessionManager().putSession(session);
SocketSessionEventListenerWrapper linkable = context.getSessionEventListenerLink();
if (linkable != null) {
linkable.sessionOpened(session);
}
}
}
use of com.generallycloud.baseio.protocol.DefaultChannelFuture in project baseio by generallycloud.
the class Http2PrefaceFuture method doComplete.
private void doComplete(SocketChannel channel, ByteBuf buf) throws IOException {
Http2SocketSession session = (Http2SocketSession) channel.getSession();
session.setPrefaceRead(false);
if (!isPreface(buf)) {
throw new IOException("not http2 preface");
}
session.doFlush(new DefaultChannelFuture(context, PREFACE_BUF.duplicate()));
}
Aggregations