Socket Programming in Python raising error socket.error:< [Errno 10060] A connection attempt failed

后端 未结 1 1403
星月不相逢
星月不相逢 2021-01-27 16:41

I am new to Socket Programming. I have implemented the client and server script for transferring the file over internet. Both scripts are working on Local Area Network computers

相关标签:
1条回答
  • 2021-01-27 17:33

    Each network adapter in the server should be associated with its own iP address.

    The s.bind() command should use the IP or host name associated with the network adapter on which you wish to listen for a connector. This should be an adapter attached to the network on which the clients are running.

    Also if the connection is going out side the local network, you must be using an IP that is publicly visible. You can read about IP assignments here and many other places (Google is your friend). Normally public IP addresses will be assigned by your ISP (sometimes for additional cost since they are a scarce resource.)

    Thanks to @jasonharper for pointing out the public vs private IP issue in a comment.

    0 讨论(0)
提交回复
热议问题