How to create server probe that binds to any available port?

Discussion created by JeffRosenzweig62353713 on Sep 16, 2009
Latest reply on Sep 18, 2009 by JeffRosenzweig62353713
NIMSESS *sess = nimSession(NULL, NIMPORT_ANY);
/* sess->iPort  always seems to return 0 */

nimRegisterProbe(probeName, probePort);
/* if probePort is 0, my probe doesn't seem  bind to an open port, but if I explicitly set probePort to an open port, my probe's command interface works. */

How do I get the the system to bind my probe to any available port?

/* tried the following, but it doesn't work either */

NIMSESS *sess = nimSessionNew();

nimSessionServer(sess, NIMPORT_ANY);

nimRegisterProbe(probeName, sess->iPort);