Dear Maurizio,
you are wrong. I put the following line immediately before and after ns_writer:
ns_log notice "\nThe connection is [ad_conn isconnected]"
and as I already said the connection is detached immediately after ns_writer.
Anyway it's a good idea to replace the deprecated calls with the suggested ones.
Claudio