@Override
    public void close( boolean flushData )
    {
        if( flushData ) {
            closing = true;
            
            // Enqueue a close marker message to let the server
            // know we should close
            send( CLOSE_MARKER, false, true );
            
            return;
        }
    
        try {
            // Note: even though we may be disconnected from the socket.isConnected()
            // standpoint, it's still safest to tell the kernel so that it can be sure
            // to stop managing us gracefully.
            kernel.closeEndpoint(this);
        } catch( IOException e ) {
            throw new KernelException( "Error closing endpoint for socket:" + socket, e );
        }
    }
Endpoint implementation that encapsulates the
 channel IO based connection information and keeps
 track of the outbound data queue for the channel.

 @version   $Revision$
 @author    Paul Speed
jme3-networking/src/main/java/com/jme3/network/kernel/tcp/NioEndpoint.java