title: problem in conn.recv(1024) in python in socket programming
body: <p>when i run this code the connection is ok but i mentioned <code>data=input('client: ')</code> in the client side and this part is not working when client and server connected together.
  How can i solve this problem?</p>
  <hr />
  <h2>server code:</h2>
  <pre class="lang-py prettyprint-override"><code>from kivy.uix.label import Label
  from kivy.uix.textinput import TextInput
  from kivy.uix.button import Button
  from kivy.uix.gridlayout import GridLayout
  from kivy.app import App
  
  
  
  import socket
  from threading import Thread
  
  
  class Me(App):
      def __init__(self,conn, addr):
          super().__init__()
          self.conn=conn
          self.addr = addr
          self.b = Button(text='start server', on_press=self.callback)
          self.g = GridLayout(cols=4)
          self.l = Label(text='listening...')
          self.t = TextInput(hint_text='Type here your message: ')
          self.g.add_widget(self.b)
          self.g.add_widget(self.t)
          self.g.add_widget(self.l)
  
      def build(self):
          return self.g
  
  
      def stream(self):
          while True:
              self.conn,self. addr=self.sock.accept()
              print(self.addr)
              self.conn.send(self.t.text.encode())
              print(f&quot;{self.t.text} sended!&quot;)
              Thread(target=m.rec())
      def rec(self):
              self.l.text=self.conn.recv(1024)
              
  
      def callback(self, click):
          self.sock = socket.socket()
          self.sock.bind(('localhost', 1234))
          self.sock.listen(1000)
          Thread(target=self.stream).start()
          print(&quot;server started&quot;)
  
  
  m = Me('','')
  m.run()
  </code></pre>
  <hr />
  <h2>client code:</h2>
  <pre class="lang-py prettyprint-override"><code>import socket
  from threading import Thread
  
  class soc():
          def __init__(self,s):
                  
                  self.s=socket.socket()
                  self.s.connect(('localhost',1234))
                  Thread(target=self.rec()).start()
                  Thread(target=self.sen()).start()
          
          def rec(self):
                  print(self.s.recv(1234))
                  self.s.close()
          def sen(self):
                  data=input('client: ')
                  self.s.send(data.encode())
                  self.s.close
  
  soc=soc('s')
  soc 
  </code></pre>