First working p2p chat for 2 clients. I used the dataset base to simulate IPs of
clients. In open.db I've stored two ports. The first client takes the first port
and moves it to taken.db. The second client takes the remaining port and puts it
to taken. If a client disconnects the port is removed from taken and appended to
open. In this way I keep track of online clients. Now if client one trys to
connect (connect button!), it will look up if client two is online. If connected
client two can send data to client one (not the other way around! Client two
needs to be connected to client one in order to be able to receive data). The
ips.py, open.db and taken.db are only needed for the proof-of-principle. You can
try to add another port to open.db, but I cannot guarantee it's going to work
since I haven't tested it yet.
The code is still a mess and I'll have to clean it up. Maybe someone can help
me 'winkers'.
I have added a clean history button - life's bearable again...