Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Sending a UDP packet fails within the Cluster environment on Windows #5587

@seriousManual

Description

@seriousManual

I was trying to send a UDP packet from a application that uses the cluster module. This fails on Windows, on Linux it works fine.

Code to reproduce:

var dgram = require('dgram');
var cluster = require('cluster');
var http = require('http');

var socket = dgram.createSocket('udp4');

if (cluster.isMaster) {
    for (var i = 0; i < 4; i++) {
        cluster.fork();
    }
} else {
    http.createServer(function(req, res) {
        var message = new Buffer('test');

        socket.send(message, 0, message.length, 123, 'xxx');

        res.writeHead(200);
        res.end('hello world\n');
    }).listen(8000);
}

Tested on:

works:
Linux, node v0.8.2
Linux, node v0.10.8

does not work:
Windows7 x64, node v0.10.0
Windows7 x64, node v0.10.8

Error message:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: write ENOTSUP - cannot write to IPC channel.
    at errnoException (child_process.js:980:11)
    at ChildProcess.target.send (child_process.js:455:16)
    at Worker.send (cluster.js:401:21)
    at sendInternalMessage (cluster.js:394:10)
    at handleResponse (cluster.js:177:5)
    at respond (cluster.js:192:5)
    at Object.messageHandler.queryServer (cluster.js:242:5)
    at handleMessage (cluster.js:197:32)
    at ChildProcess.EventEmitter.emit (events.js:117:20)
    at handleMessage (child_process.js:318:10)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions