title: Python socket server receiving duplicate data
body: <p>I have a raspberry running a server that communicates with a server on my laptop. I've done this through simple socket connections on python.</p>
  
  <p>Like so:</p>
  
  <p>server </p>
  
  <pre><code>HOST = "192.168.0.115"
  PORT = 5001
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.bind((HOST,PORT))
  s.listen(1)
  
  conn, addr = s.accept()
  while conn:
      data = conn.recv(1024)
      print data
      if not data:
           break
  conn.close()
  </code></pre>
  
  <p>client</p>
  
  <pre><code>__init__(self,addr,port,timeout):
     self.addr = addr
     self.port = port
     self.timeout = timeout
     self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     self.socket.connect((self.addr,self.port))
  
  #in a different file the call to send is made, passes list object as a parameter
  
  send(self,data):
      if self.socket:
          self.socket.send(str(data))
  </code></pre>
  
  <p>setting a print statement in the client code results in (x,y,z), which is the expected output. However, upon receiving the data on server it appears in a pattern:</p>
  
  <pre><code>(x,y,z)(x,y,z)
  (x,y,z)
  (x,y,z)
  (x,y,z)(x,y,z)
  ...
  </code></pre>
  
  <p>Why is the data being received as duplicates? Is it a property of TCP? If so, how can I counter this to receive the data as one sent string as I had initially. </p>