You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server code:
var worker = child_process.fork('child.js');
var server = nssocket.createServer(function(socket) {
socket.data('data', function (data) {
worker.send(data.toString('utf8'), socket.socket, {keepOpen: true});
});
});
function send(socket, event, data, callback) {
var delimiter = '::';
if (typeof event === 'string') {
event = event.split(delimiter);
}
var message = Buffer(JSON.stringify(event.concat(data)) + '\n');
socket.write(message, callback);
};
The client send 10 requests and after timeout from 1000 milliseconds send another 10 request and so on.
The first 10 request have their responses, but next lost responses.
I use nssocker v0.6.0, Node.js v6.9.4 and testing on Windows 10 with NetBeans IDE 8.2
The text was updated successfully, but these errors were encountered:
Server code:
var worker = child_process.fork('child.js');
var server = nssocket.createServer(function(socket) {
socket.data('data', function (data) {
worker.send(data.toString('utf8'), socket.socket, {keepOpen: true});
});
});
child.js
process.on('message', function(data, socket) {
send(socket, 'data', data);
});
function send(socket, event, data, callback) {
var delimiter = '::';
if (typeof event === 'string') {
event = event.split(delimiter);
}
var message = Buffer(JSON.stringify(event.concat(data)) + '\n');
socket.write(message, callback);
};
The client send 10 requests and after timeout from 1000 milliseconds send another 10 request and so on.
The first 10 request have their responses, but next lost responses.
I use nssocker v0.6.0, Node.js v6.9.4 and testing on Windows 10 with NetBeans IDE 8.2
The text was updated successfully, but these errors were encountered: