File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
blog/25-12-03/unix-sockets/ex Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 77 var net = require ( 'net' ) ;
88 var PIPE_PATH = '/tmp/mysock' ;
99
10- // Clean up old socket file if it exists
10+ // Clean up old socket file if it exists
1111 if ( fs . existsSync ( PIPE_PATH ) ) {
1212 fs . unlinkSync ( PIPE_PATH ) ;
1313 }
1616 var server = net . createServer ( con => {
1717 console . log ( 'Client connected' ) ;
1818 con . on ( 'data' , data => {
19- console . log ( 'Received from client:' , data . toString ( ) ) ;
19+ console . log ( 'Received from client:' , data . toString ( ) ) ;
2020 } ) ;
2121
2222 con . on ( 'end' , ( ) => {
2323 console . log ( 'Client disconnected' ) ;
2424 } ) ;
25- // Send a test message
25+ // Send a test message
2626 con . write ( 'Hello from Node server over Unix socket!' ) ;
2727
2828 } ) ;
2929
3030 server . listen ( PIPE_PATH , ( ) => {
31- console . log ( 'Server listening on' , PIPE_PATH ) ;
31+ console . log ( 'Server listening on' , PIPE_PATH ) ;
3232 } ) ;
3333
3434
You can’t perform that action at this time.
0 commit comments