-v: Verbose#

The -v option will print status messages to stderr.
This can be useful to see whether a machine has connected to your server or whether a connection attempt was successful or not.

Example#

  1. Create a test TCP server:

pync -lv localhost 8000
py -m pync -lv localhost 8000
import pync
pync.run('-lv localhost 8000')
  1. On a separate console, connect to the server:

pync -v localhost 8000
py -m pync -v localhost 8000
import pync
pync.run('-v localhost 8000')

You should now be able to see messages printed on each console indicating that the connection was successful:

Listening on [localhost] (family 2, port 8000)
Connection from [127.0.0.1] port 8000 [tcp/*] accepted (family 2, sport 44650)
Connection to 127.0.0.1 8000 port [tcp/*] succeeded!

You can also create a simple port scanner by combining -v with the -z option.
See Port Scanning for more.


SEE ALSO: