I've tried the two main versions of netcat : GNU and BSD. (mine is BSD Version).
On GNU version, the command $ nc -l -p 12345 works fine but with BSD, option -l (listen) can't be used in conjonction with -p (local port).
I don't understand why there is a such difference between these two versions ? In the BSD version, when I use option -p, it calls automatically -l (listen) ?
Ps: https://bugs.launchpad.net/ubuntu/+source/netcat-openbsd/+bug/590925/comments/3 -p is different between the two. The OpenBSD version uses it to set a source port for remote connections, while the traditional nc uses it to specify the local port on which it will listen when in listen mode.