title: Python Socket async send and receive design
body: <p>I am writing a python socket client which</p>
  
  <ol>
  <li>Send out <code>message one</code> (e.g. Hello) every 5 seconds and <code>message two</code> (e.g. 15 seconds) every 15 seconds</li>
  <li>Receive message at any time</li>
  </ol>
  
  <p>I mean to do the send and receive in different thread. However it is still blocking. 
  Does anyone has suggestion?</p>
  
  <p>Thread #1</p>
  
  <pre><code>threading.Thread(target=Thread2, args=(sock)).start()
  sock.recv(1024)
  </code></pre>
  
  <p>Thread #2</p>
  
  <pre><code>def Thread2(sock):
      count = 0
      while True:
          sleep(5)
          count = count + 5
          sock.send('Hello')
          if count % 15 == 0
              sock.send('15 seconds')
  </code></pre>