title: be maked Infinite loop in python.3
body: <p>i want to make one server and client in the python.3
  this is my server:</p>
  <pre><code>import socket
  
  ip =('192.168.1.101',12345)
  s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
  
  s.bind(ip)
  
  s.listen(1)
  
  print('Server is ready')
  
  client , addr = s.accept()
  
  print('one client has conected to me'+str(addr))
  
  while True:
  
      a = input('what do you want to tell ? ')
      if a == 'q':
          break
  
      a=a.encode('utf_8')
  
      client.sendall(a)
  
  client.close()
  </code></pre>
  <p>and my client is :</p>
  <pre><code>import socket
  
  ip = ('192.168.1.101', 12345)
  conecttion = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  
  conecttion.connect(ip)
  
  while True:
      data = conecttion.recv(1024)
      
      if data == 'q':
          break
  print(data)
  
      
  conecttion.close()
  </code></pre>
  <p>but when i send 'q' in the client be maked Infinite loop.
  what should i to do when i send 'q' the conection be closed.
  who can help me.</p>