Answer the question
In order to leave comments, you need to log in
Why is the socket closed immediately after receiving a response?
There is an example client in Node.js
var net = require('net');
var client = new net.Socket();
client.connect(3333, 'localhost', function() {
console.log('Connected');
client.write('Hello, server! Love, Client.');
});
client.on('data', function(data) {
console.log('Received: ' + data.toString());
//client.destroy();
});
client.on('close', function() {
console.log('Connection closed');
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question