0

I'm new in python so please bear with me. I'm writing a GUI with server side and client side. clients are able to connect to the server. Then the server can choose clients that it wants to communicate with.

But now i'm facing a problem. I don't know how to send message to specific client. I did some research. It seem that i need a list to save the client's connection. But i still don't really understand it. So i'm looking for some simple example or clear concept. Thank you very much.

1 Answer 1

1

I hope this could help you. This could assign a separate name for the client and then you can do the rest.

    mydict = {}
    mydict[clientname] = self._address
    #get user by name

    for client,addr in mydict.iteritems():
       if client == "xx":
           destinationaddr = addr
           break
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.