I have a problem with nodejs. I have a python twisted tcp server and when I am trying to do this:
var socket = server.net.createConnection(server.controllerPort,
server.controllerHost);
socket.on('data', function(data) {
log('RESPONSE: ' + data);
});
socket.on('connect', function() {
socket.write("1 message \r\n");
socket.write("2 message \r\n");
socket.destroy();
});
instead of 2 messages, twisted receives "1 message \r\n 2 message \r\n")
Of course, I tested by using python, php, c++ and it works. But I am having trouble doing the same in nodejs.