code: private void prepareTransport(boolean useRtuOverTcp) throws IOException {
  
          // If we don't have a transport, or the transport type has changed
          if (transport == null || (this.useRtuOverTcp != useRtuOverTcp)) {
  
              // Save the flag to tell us which transport type to use
              this.useRtuOverTcp = useRtuOverTcp;
  
              // Select the correct transport
              if (useRtuOverTcp) {
                  logger.trace("prepareTransport() -> using RTU over TCP transport.");
                  transport = new ModbusRTUTCPTransport(socket);
                  transport.setMaster(this);
              }
              else {
                  logger.trace("prepareTransport() -> using standard TCP transport.");
                  transport = new ModbusTCPTransport(socket);
                  transport.setMaster(this);
              }
          }
          else {
              logger.trace("prepareTransport() -> using custom transport: {}", transport.getClass().getSimpleName());
              transport.setSocket(socket);
          }
          transport.setTimeout(timeout);
      }
docs: Prepares the associated <tt>ModbusTransport</tt> of this
  <tt>TCPMasterConnection</tt> for use.
  
  @param useRtuOverTcp True if the RTU protocol should be used over TCP
  
  @throws IOException if an I/O related error occurs.