$port = xdmp:host-status(xdmp:host())//*:port

-----------------------------------------------------------------------------
David Lee
Lead Engineer
MarkLogic Corporation
[email protected]
Phone: +1 812-482-5224
Cell:  +1 812-630-7622
www.marklogic.com<http://www.marklogic.com/>


From: [email protected] 
[mailto:[email protected]] On Behalf Of Jakob Fix
Sent: Thursday, May 16, 2013 6:56 PM
To: General Mark Logic Developer Discussion
Subject: [MarkLogic Dev General] how can i check whether an appserver

Hello,

if I wanted to script the creation of an xdbc appserver and I don't really care 
about the port number to use (so let's say I use xdmp:random(65535) + 8003), 
how can I find out whether that port is already in use by an already existing 
server?

Basically I'm looking for a definition of the local:port-number-in-use($pn) 
below.
declare function local:get-port-number()
as xs:integer
{
    let $pn := xdmp:random(65535 + 8003)
    return
        if (local:port-number-in-use($pn))
            then local:get-port-number()
            else $pn
};
cheers,
Jakob.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to