node.js socket.write() not work on if condition

i have a problem with it, on the part of the "IF" condition, i need to send menssage "socket.write('11')", but it not send the menssage if the second "socket.write" is not on the code. On my code,i dont need the second write. Why happend that?

** I found other error, if i not put the var "data" on a socket.write(), it not send any menssage to the client.

Regards

var net = require('net');
var HOST = '192.168.0.104';
var PORT = 6060;
var connections = 0;

var clients = [];

net.createServer(function (socket) {

// Identify this client
socket.name = socket.remoteAddress + ":" + socket.remotePort

// Put this new client in the list
clients.push(socket);

// Send a nice welcome message and announce
socket.write("Welcome Client: " + socket.name + "\n");
connections++;
console.log('Active connections: ' + connections);
console.log(socket.name + " joined the chat.");

// Handle incoming messages from clients.
socket.on('data', function (data) {
var response = data.toString();
var recv = response.length;

if (recv == 16){
socket.write('11'); //****** First write
console.log("11");
}

console.log(socket.name + "length: " + recv);

socket.write('You said: "' + data); //***** Second write

});


// Remove the client from the list when it leaves
socket.on('end', function () {
clients.splice(clients.indexOf(socket), 1);
console.log(socket.name + " left the chat.");
connections--;
console.log('Active connections: ' + connections);
});

}).listen(PORT, HOST);

 // Put a friendly message on the terminal of the server.
console.log('Server listening on ' + HOST +':'+ PORT);

Check out socket.setNoDelay method.

Additionally you may use the return value of the socket.write to detect whether the data was sent to the wire.