Checking refusal of a network connection

Markus Elfring Markus.Elfring at web.de
Fri May 31 11:35:42 EDT 2019


Hello,

I can start a service as desired.

elfring at Sonne:~/Projekte/Bau/C++/test-statistic-server1/local> ./test-statistic-server2 & /usr/bin/ss -t -l -p -H|grep test
[1] 8961
waiting for connections
server_id: localhost
server_port: 35529
LISTEN     0           123                  [::1]:35529              [::]:*      users:(("test-statistic-",pid=8961,fd=3))
elfring at Sonne:~/Projekte/Bau/C++/test-statistic-server1/local> 0 connections were handled.


But I wonder about the following error message then.

elfring at Sonne:~/Projekte/Python> /usr/bin/python3 ~/Projekte/Python/socket-send_json_data.py --server_id localhost --server_port 35529
Using Python version:
3.7.2 …
Traceback …:
…
  File "/home/elfring/Projekte/Python/socket-send_json_data.py", line 17, in send_data
    so.connect((args.server_id, args.server_port))
ConnectionRefusedError: [Errno 111] Connection refused


How should this inter-process communication difficulty be resolved?

Regards,
Markus


More information about the Python-list mailing list