title: Python3.6, OSError: [Errno 57] Socket is not connected
body: <p>I was trying to write a protocol like UDP in python, which include some details like three_handshake, but I can't run the server.py cause it told me like this:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/Users/suiyoucheng/PycharmProjects/9331 ASS/receiver.py", line 
  38, in &lt;module&gt;
  BYTE_fh, senderAddress = receiverSocket.recvfrom(1024)
  OSError: [Errno 57] Socket is not connected
  </code></pre>
  
  <p>and my server.py code shown as below:</p>
  
  <pre><code>try:
      receiverSocket = socket(AF_INET, SOCK_STREAM)
  except:
      print("Failed to create receiver socket.")
      sys.exit()
  
  
  receivePort = 2000
  try:
      receiverSocket.bind(('', receivePort))
  except:
      print("Bind failed.")
      sys.exit()
  
  #                           First Hand Shake                              #
  
  receiver_ISN = 0
  receiver_ITIME = time.time()
  
  
  BYTE_fh, senderAddress = receiverSocket.recvfrom(1024) #**where I got wrong**#
  first_hand = pickle.loads(BYTE_fh)
  </code></pre>
  
  <p>Could you guys tell me how to fix that? Thank you so much.</p>