title: Error with TCP send in Python - Protocol wrong type for socket
body: <p>I am trying to send an integer value from a server written in Python to a client written in C and when I convert the int value to htonl to send to the C like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>size = bytes(socket.htonl(len(input)))
  </code></pre>
  
  <p>it returns this error: Protocol wrong type for socket for this line:   </p>
  
  <pre class="lang-py prettyprint-override"><code>recv = connection.send(size)
  </code></pre>
  
  <p>How can I send an integer value over to the client in C in this way or is there an easier way?</p>