example:
```
#!/usr/local/bin/nodejs

var cluster = require("cluster");
var dgram = require("dgram");

var workers = {};

console.log("#" + process.pid + ", start");
if (cluster.isMaster) {
    for (i = 0; i < 2; i++) {
        var worker = cluster.fork();
        var _pid = worker.process.pid;
        workers[_pid] = worker;
        workers[_pid].udpPorts = {};
        workers[_pid].on("message", function(payload) {
            //Generate Random Port For Worker
            if (payload && payload.pid && workers[payload.pid] && payload.action == "getPort") {
                console.log("#" + process.pid + ", Master Sending a New Random Port to Child...");
                var udp = dgram.createSocket("udp4");
                udp.on("listening", function() {
                    var self = this;
                    var address = self.address();
                    workers[payload.pid].udpPorts[address.port] = self;
                    workers[payload.pid].send({
                        "pid": process.pid,
                        "action": payload.action,
                        "param": {
                            "port": address.port
                        }
                    });
                });
                udp.bind(0);
            }
            //Close Port For Worker
            if (payload && payload.pid && workers[payload.pid] && payload.action == "releasePort") {
                console.log("#" + process.pid + ", Close a Specific Port From Child, " + payload.action + ": " + payload.param.port);
                if ( workers[payload.pid].udpPorts[payload.param.port] ) {
                    workers[payload.pid].udpPorts[payload.param.port].close();
                    delete workers[payload.pid].udpPorts[payload.param.port];
                } 
            }
        });
    }
} else {
    process.on("message", function(payload) {
        if (payload && payload.action == "getPort") {
            console.log("#" + process.pid + ", Child get New Port from Master, " + payload.action + ": " + payload.param.port);
            //Release Port in Master
            console.log("#" + process.pid + ", Child Request to Master close the port...");
            process.send({
                "pid": process.pid,
                "action": "releasePort",
                "param": {
                    "port": payload.param.port
                }
            });
        }
    });
    //Get Random Port from Master
    console.log("#" + process.pid + ", Child Request to Master a New Random Port...");
    process.send({
        "pid": process.pid,
        "action": "getPort"
    });
    console.log("#" + process.pid + ", Child Request to Master a New Random Port...");
    process.send({
        "pid": process.pid,
        "action": "getPort"
    });
}

```

output

```
#38256, start
#38257, start
#38257, Child Request to Master a New Random Port...
#38257, Child Request to Master a New Random Port...
#38256, Master Sending a New Random Port to Child...
#38256, Master Sending a New Random Port to Child...
#38257, Child get New Port from Master, getPort: 49444
#38257, Child Request to Master close the port...
#38257, Child get New Port from Master, getPort: 62652
#38257, Child Request to Master close the port...
#38256, Close a Specific Port From Child, releasePort: 49444
#38256, Close a Specific Port From Child, releasePort: 62652
#38258, start
#38258, Child Request to Master a New Random Port...
#38258, Child Request to Master a New Random Port...
#38256, Master Sending a New Random Port to Child...
#38256, Master Sending a New Random Port to Child...
#38258, Child get New Port from Master, getPort: 62293
#38258, Child Request to Master close the port...
#38256, Close a Specific Port From Child, releasePort: 62293
#38258, Child get New Port from Master, getPort: 49300
#38258, Child Request to Master close the port...
#38256, Close a Specific Port From Child, releasePort: 49300
```