You are reading a single comment by @Injecteer and its replies. Click here to read the full conversation.
  • I have the following code snippet:

    var options = { host:"192.168.0.113", port:8823 };		
    var socket = require("net").connect( options, function() {
           socket.on('data', function(data) {
                console.log("HTTP> "+data);
           } );
    } );
    socket.end( JSON.stringify( obj ) );		
    console.log( 'should be sent by now' );
    

    Upon running, the server does not receive any data.

    I tried also socket.write( JSON.stringify( obj ) ) and putting write/end calls inside of the callback function - neither worked.

    The test code in Groovy works just fine:

    Socket s = new Socket()
    s.connect( new InetSocketAddress( "192.168.0.113", 8823 ) )
    s.outputStream.withWriter{ it << 'aaaaa' }
    
About

Avatar for Injecteer @Injecteer started