added the following to prevent writting to a socket that is not bound   - if (!clientChannel.finishConnect() || !clientChannel.socket().isBound())