node.js - BinaryJS Server Response -


given example bellow:

binaryserver = binaryserver({port: 9001});  binaryserver.on('connection', function(client) {   console.log("new connection");     client.on('stream', function(stream, meta) {     console.log('new stream');     strean.on('data', function('data'){     //(code store audio in buffers)});      stream.on('end', function() {       //end of stream       //(routine calls addon , convert speech text)       //****immediate response client******     });   }); }); 

now, objective send response (to client) when generated. trying binaryjs cant understand how.

server side:

binaryserver = binaryserver({port: 9001});  binaryserver.on('connection', function(client) {   console.log("new connection");     client.on('stream', function(stream, meta) {     console.log('new stream');     strean.on('data', function('data'){     //(code store audio in buffers)});      stream.on('end', function() {       //end of stream       //(routine calls addon , convert speech text)       //****immediate response client******       stream.write(some_variable);<---just     });   }); }); 

client side:

client.on('open', function() {      stream = client.createstream("some meta information);     //(some rotines)     stream.on('data', function(data){ ///-->recebe resposta stream.write()           console.log("resultado: "+data);     }); } 

);


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -