@Override
    public VirtualConnection write(long numBytes, TCPWriteCompletedCallback writeCallback, boolean forceQueue, int timeout) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "write(" + numBytes + ",..," + forceQueue + "," + timeout + ")");
        }
        getTCPConnLink().incrementNumWrites();
        if (getConfig().getDumpStatsInterval() > 0) {
            getTCPConnLink().getTCPChannel().totalAsyncWrites.incrementAndGet();
        }
        // always check external call parms
        checkForErrors(numBytes, true, timeout);
        // reset
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Socket socket = getTCPConnLink().getSocketIOChannel().getSocket();
            Tr.event(tc, "write (async) requested for local: " + socket.getLocalSocketAddress() + " remote: " + socket.getRemoteSocketAddress());
        }
        VirtualConnection vc = null;
        if (isAborted()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Previously aborted, unable to perform write");
            }
            // async errors can only be passed through the callback, which means
            // if they didn't provide one then we have no way of reporting the
            // failure
            if (null != writeCallback) {
                IOException ioe = new IOException("Connection aborted by program");
                writeCallback.error(getTCPConnLink().getVirtualConnection(), this, ioe);
            }
        } else {
            vc = writeInternal(numBytes, writeCallback, forceQueue, timeout);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "write: " + vc);
        }
        return vc;
    }
@ Override public VirtualConnection write ( long numBytes , TCPWriteCompletedCallback writeCallback , boolean forceQueue , int timeout ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "write(" + numBytes + ",..," + forceQueue + "," + timeout + ")" ) ; } getTCPConnLink ( ) . incrementNumWrites ( ) ; if ( getConfig ( ) . getDumpStatsInterval ( ) > 0 ) { getTCPConnLink ( ) . getTCPChannel ( ) . totalAsyncWrites . incrementAndGet ( ) ; } checkForErrors ( numBytes , true , timeout ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Socket socket = getTCPConnLink ( ) . getSocketIOChannel ( ) . getSocket ( ) ; Tr . event ( tc , "write (async) requested for local: " + socket . getLocalSocketAddress ( ) + " remote: " + socket . getRemoteSocketAddress ( ) ) ; } VirtualConnection vc = null ; if ( isAborted ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Previously aborted, unable to perform write" ) ; } if ( null != writeCallback ) { IOException ioe = new IOException ( "Connection aborted by program" ) ; writeCallback . error ( getTCPConnLink ( ) . getVirtualConnection ( ) , this , ioe ) ; } } else { vc = writeInternal ( numBytes , writeCallback , forceQueue , timeout ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "write: " + vc ) ; } return vc ; }
external async write