 <p>The receiver expects 4 bytes of string data to signify the length of the remaining data to be received. In this case, your first four bytes don't contain a valid text-integer (like "1234"), so the call to <code>int()</code> is failing.</p>