First, let's get the item straight. Typically, the part that initiates the connection is the client, the parts that are waiting for the connection are the server, which will then receive data from the client and generate a response. From your question, βhostβ is the client, and βclientβ seems to be the server.
Then you need to decide how to transfer the data. You can use direct sockets, in which case you can use SocketServer, or you can rely on an existing protocol, such as HTTP or XML-RPC, in which case you will find ready-to-use library packages with a lot of examples (for example, xmlrpcliband SimpleXMLRPCServer)
source
share