If i am sending data from php to nodejs I get this error on my console: http://ift.tt/1yGtpDN
How can I fix that error? Thanks !
That's my code in nodejs:
var Server = net.createServer(function(Sock) {
Sock.on('data', function(data) {
dataObj = JSON.parse(data);
logger.info("received data");
});
Sock.pipe(Sock);
});
and thats my php code:
$data = array('xxx' => 'xxx');
// Prepares to transmit it
$encdata = json_encode($data);
socket_write($socket, $encdata, strlen($encdata));
socket_close($socket);
Aucun commentaire:
Enregistrer un commentaire