Originally used to refer to a old and decrepit rooster, the term was adapted to be used as an insult to a man's masculinity.
"Bob was such a cocksnozzle at the party last night, he didn't even talk to any girls."