Further to this, I suspect the remote side is dropping your TCP connection before or during the SNMP set request. Can you confirm this by running Wireshark (formally known as Ethereal) to determine if, indeed, the connection is dropped?
Ask yourself why the remote end (server) might drop a connection - bad set request? Malformed packet? Timeout? Something else?