title: How do I end a client server transmission after it hits a limit of 10
body: <p>I'm new to networking and need some help with completing the transmission after it transmits ten strings. </p>
  
  <p>Here's the my server side </p>
  
  <pre><code>import socket           
  import time 
  from string import capitalize
  from test.test_urllib2net import CloseSocketTest
  from findertools import shutdown
  
  host = "localhost" 
  port = 3030
  data = "just some text"
  data = data.encode('utf-8')
  
  s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)        
  
  while 1:
    s.sendto(data,(host,port))
    print (capitalize("sent " + data.decode('utf-8')))
    time.sleep(1)
  </code></pre>
  
  <p>client </p>
  
  <pre><code>import socket
  from server import host
  from string import capitalize
  
  HOST = "localhost"
  PORT = 3030
  
  t = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
  
  t.bind((HOST,PORT))
  
  while 1:
     print (t.recv(50))
  </code></pre>