I have this python code that works only when the TCP_IP is localhost. If I change it to some other server IP for e.g. 23.21.167.61 then it fails to send the file even if the other server is listening.
https://github.com/shantanuo/socket/blob/master/server2.py
I get an error while binding to IP. I can use coect method but then I will not be able to take advantage of threading as explained here... http://www.bogotobogo.com/python/python_network_programming_server_client_file_transfer.php
[root@ip-10-93-136-166 ec2-user]# python server2.py
Traceback (most recent call last):
File "server2.py", line 34, in <module>
tcpsock.bind((TCP_IP, TCP_PORT))
File "/usr/lib64/python2.7/socket.py", line 228, in meth
retu getattr(self._sock,name)(*args)
socket.error: [Ero 99] Caot assign requested address
