But he was not long allowed to enjoy the pleasure which he expected, after such a trial of danger and fatigue. In less than a week after he arrived at Philadelphia, he was offered the command of the Hyder Ally, of sixteen guns, fitted out by the state authorities of Pennsylvania, to repress the enemy's privateers, with which the Delaware river abounded.
On the 8th of April, 1782, he entered upon his destined service, which was to convoy a fleet of merchantmen to the capes, and to protect them from the "refugee boats," with which the river abounded. While waiting at the capes, he was assailed by two ships and a brig belong to the enemy, who, finding him unsupported, commenced a furious attack, which he sustained with great coolness, while his convoy were safely retiring up the river. The brig came up first, and gave him a broadside as she was passing; but kept her course up the bay after the convoy, while Barney waited for the ship, which was coming up rapidly. Having approached within pistol shot, the Hyder Ally poured a broadside into her, which somewhat staggered the enemy, who thought Barney would "strike his colors." The enemy seemed disposed to board, and was ranging alongside of him, when he ordered the quarter-master, in a loud voice, to "port the helm!"--having previously given him secret instructions to put the helm hard a-starboard, which latter order was obeyed; by this manoeuvre the enemy's jib-boom caught in the fore-rigging of the Hyder Ally, thus giving her a raking position, which Captain Barney knew how to improve. The firing on both sides was tremendous;--an idea of it may be obtained from the fact, that more than twenty broadsides were fired in twenty-six minutes! In the mizzen staystail of the General Monk there were afterwards counted, three hundred and sixty-five shot-holes. During the whole of this short but glorious battle, Captain Barney was stationed upon the quarterdeck, exposed to the fire of the enemy's musketry, which was excessively annoying, and began to be felt by the men, insomuch that Captain Barney ordered a body of riflemen, whom he had on board, to direct their fire into the enemy's top, which immediately had the desired effect.