0

I'm I created a server/client python script that uses socks. I'm trying to send data to a specific client. I would image I would have to load connected ip's into array but I don't know how to send data to specific client. I'v uploaded my code to pastebin as I figured that might help get the best answer. http://pastebin.com/en863i1s

1 Answers1

3

You don't have to close the clientsocket. You can have more connections open. Each one is an established connection.

To send data to a specific client just call the .sendall(...) method (more info here) of the specific client socket object.

Btw if you're trying to implement a traditional client/server model for production and not for learning purposes, try to not reinvent the wheel and use something like Tornado or the builtin SocketServer

Paolo Casciello
  • 7,982
  • 1
  • 43
  • 42
  • Thanks for your answer now I can complete my project :) I will up vote when I get enough rep. –  Mar 28 '14 at 10:35