public boolean startUsingDataSocket(){
  try {
    dataSocket=localDataSocket.onTransfer();
    if (dataSocket == null) {
      Log.i(TAG,"dataSocketFactory.onTransfer() returned null");
      return false;
    }
    dataOutputStream=dataSocket.getOutputStream();
    return true;
  }
 catch (  IOException e) {
    Log.i(TAG,"IOException getting OutputStream for data socket");
    dataSocket=null;
    return false;
  }
}

public boolean startUsingDataSocket ( ) { try { dataSocket = localDataSocket . onTransfer ( ) ; if ( dataSocket == null ) { Log . i ( TAG , "dataSocketFactory.onTransfer() returned null" ) ; return false ; } dataOutputStream = dataSocket . getOutputStream ( ) ; return true ; } catch ( IOException e ) { Log . i ( TAG , "IOException getting OutputStream for data socket" ) ; dataSocket = null ; return false ; } }
will be called by ( e . g . ) cmdstor , cmdretr , cmdlist , etc . when they are about to start actually doing io over the data socket .
