node.js - NodeJS TCP Server Does Not Receive Data -


i'm trying create simple receive-only socket server, in nodejs v0.12.0, receive messages via tcp. seems no data received unless nodejs net server response line feed after each data event.

var server = net.createserver(function( socket ) {     socket         .setencoding( 'utf8' )         .on( 'data', function( cdata ) {             console.log( 'cdata' );             console.log( cdata );              // uncomment receive data.             //socket.write( '\n' );         });          // uncomment receive data.         //socket.write( '\n' ); }).listen( 84, '127.0.0.1' ); 

then client this...

setinterval( function(){     client.write( 'test\n' ); }, 1000 ); 

unless send line feed when client connects , line feed each data event, no further data events triggered. missing something? have reply sort of message each data event, or there option receive data without sending response?

test confirmed. problem original tests on machine using port 110 not 84. once disabled symantec endpoint protection starting up, tests worked fine. protection program must create proxy between client , server, on local connections, , act relay. why line feed "\n" became such magical character. proxy relay created symantec on machine expecting pop3 protocol.

thanks saving sanity luke!


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -