TCP client cannot connect to TCP server
<p>I have configured a Raspberry Pi to be client, and my personal computer to be TCP server, and trying to connect to server via an ethernet cable. On my personal computer I use Comm Operator and select port "1234". Raspberry Pi (TCP client) has following setup:</p>

<pre><code>auto eth0
iface eth0 inet static
  address 192.168.20.45
  netmask 255.255.255.0
  gateway 192.168.20.1
</code></pre>

<p>Raspberry Pi (TCP client) has the following script to connect:</p>

<pre><code>import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('192.168.20.48',1234))
</code></pre>

<p>And frankly, it get stuck in the connect step, doesnt even get past that. On the TCP server side running on Windows, IPv4 setup is as follows:</p>

<pre><code>192.168.20.48
255.255.255.0
192.168.20.1
</code></pre>

<p>with Google DNS</p>

<pre><code>8.8.8.8
8.8.4.4
</code></pre>

<p>Weird thing is that it works the other way around, if I set up my computer as client and connect to raspberry pi. Could you give me some ideas as to what could be the problem? I really could use some opinion. Thanks in advance to everyone.</p>

<p>You probably have a firewall running on your computer. Disable it or open up the desired port.</p>

python linux sockets tcp raspberry-pi