ChannelPipeline pipeline, ChannelEvent element) throws Exception {
OioClientSocketChannel channel = (OioClientSocketChannel) element.getChannel();
ChannelFuture future = element.getFuture();
if (element instanceof ChannelStateEvent) {
ChannelStateEvent stateEvent = (ChannelStateEvent) element;
ChannelState state = stateEvent.getState();
Object value = stateEvent.getValue();
switch (state) {
case OPEN:
if (Boolean.FALSE.equals(value)) {
OioWorker.close(channel, future);