首页 > 解决方案 > How to setup a client server without localhost using python

问题描述

I am very novice with socket programming so sorry about any simple questions

My objective is to create a server which sends to several clients a csv file, clients located in different locations

I have a question about the following initial part of server and client

#TCP_IP = 'localhost'
TCP_IP = socket.gethostbyaddr("myip?")[0]
TCP_PORT = 9001

When debugging that line I get a valid isp domain but If I do it this way I get an error that the Address is not valid

Shouldnt I place my real static ip in server script and in client script?

标签: pythonpython-3.xclient-server

解决方案


推荐阅读