D46 #100DaysOfCode

We have communication!

So I’ve been working on trying to learn Python sockets, and how to make a simple chat application where I can send a message from one device to another.

I first started with running both the client and server locally on the one machine, this worked fine.

I started facing issues when I tried to point a separate device to the server via an IP address, I would just keep getting a connection refused message.

Now my issue was that I was telling the client to connect to which is my internal IP but I was setting the IP of the server to “localhost”. What I thought would happen is that localhost would resolve to it’s IP address, but I should have known better.

So after making that change from localhost to the actual IP address of my PC I started up the client script on my Raspberry PI and started the server script on my PC and BAM! Connection baby!


In doing this, I am actually pretty confident in setting this up without any documentation now so I definitely got something out of it. I went from not knowing anything about sockets to making this. I’m pretty happy about that.

Written on November 5, 2019