I think 'ad_conn isconnected' means you are in a connection thread. Check out http://zmbh.com/nsapi/ns_conn for the corresponding 'ns_conn isconnected'.