title: Socket Messaging Client/Server: Client not sending message
body: <p>I am trying to create a simple chat program using Python and Socket. The server handles the connection between two clients. Whenever I run the program, for one of the clients, every message after the first one does not send. The message does not even reach the server.</p>
  
  <p>This is on Windows, Python3. I've integrated threading so messages can be sent and received at the same time; however, the problem persists.</p>
  
  <p>Server.py</p>
  
  <pre><code>conns = [] # list that stores both connections
  
  
  def accept(sk):
      while True:
          conn, addr = sk.accept()
          conns.append(conn)
          print(addr, "has connected")
  
      t = threading.Thread(target=accept, args=(sk,))
      t.start() #start accept thread
  
  
  
  def send(conn):
      while True:
          message = conn.recv(2048)
          print(message)
          for conn in conns:
              conn.send(message) #sends message to every connection
              print("Sent message")
  
  
  t = threading.Thread(target=send, args=(conn,))
  t.start() #start threading for send
  </code></pre>
  
  <p>Client.py</p>
  
  <pre><code>def recvMessages(s):
      while True:
          message = s.recv(2048)
          print(message)
          message = message.decode()
          messages.append(message)
          os.system("cls")
  
          for message in messages:
              print(message)
  
  def sendMessage(s):
      while True:
          message = input()
          message = message.encode()
          s.send(message)
  
  s = socket.socket()
  host = socket.gethostname()
  port = 8080
  s.connect((host, port))
  messages = []
  
  print("Connected")
  connected = True
  
  
  
  
  threading.Thread(target=sendMessage, args=(s,)).start()
  threading.Thread(target=recvMessages, args=(s,)).start()
  </code></pre>
  
  <p>All the messages should be sent from both clients, but one client can never send multiple messages, the other works fine.</p>