private void accept()
    {
        ConnectionsWorker worker = findWorkerForConnection();

        SocketChannel clientSocketChannel = null;
        SocketChannel proxySocketChannel = null;

        try {
            clientSocketChannel = serverSocketChannel.accept();
            clientSocketChannel.configureBlocking(false);
            clientSocketChannel.setOption(StandardSocketOptions.SO_KEEPALIVE, true);
            clientSocketChannel.setOption(StandardSocketOptions.TCP_NODELAY, true);
            SocketChannelExtender clientSocketChannelExtender = new SocketChannelExtender(clientSocketChannel);

            proxySocketChannel = SocketChannel.open();
            proxySocketChannel.configureBlocking(false);
            proxySocketChannel.setOption(StandardSocketOptions.SO_KEEPALIVE, true);
            proxySocketChannel.setOption(StandardSocketOptions.TCP_NODELAY, true);
            SocketChannelExtender proxySocketChannelExtender = new SocketChannelExtender(proxySocketChannel);

            clientSocketChannelExtender.setSecondChannel(proxySocketChannelExtender);
            proxySocketChannelExtender.setSecondChannel(clientSocketChannelExtender);

            boolean proxyNeedFinishConnection = !proxySocketChannel.connect(proxyToAddress);

            worker.addSocketPair(clientSocketChannelExtender, proxySocketChannelExtender, proxyNeedFinishConnection);
        } catch(IOException e) {
            try {
                if (clientSocketChannel != null) {
                    clientSocketChannel.close();
                }
            } catch(IOException idle) {
            }
            try {
                if (proxySocketChannel != null) {
                    proxySocketChannel.close();
                }
            } catch(IOException idle) {
            }
        }
    }