Add debug code that shows who connected to the P2P network and who left

This debug code is inserted in order to solve the issue of not being able to
connect from different hosts. It is discovered from this debug code that IP
address 0.0.0.0 is sent to the server.
Fix issue where IP address of peer is not correctly sent to the server

This issue is caused because the local address from the ServerSocket is used.
In order to solve this, local IP address from the Socket is used.