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.

asked May 26, 2017 at 17:58

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
answered Feb 25, 2018 at 12:46
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.