Skip to content

Socket Hangup Issue #85

Open
Open

Description

@jAddict7

Dear Sir,
Thanks for the awesome work. We have GPS server running Node JS, from where the co-ordinates are pushed to another server using HTTPS node module. Every second we need to send around 60-80 requests. Node JS is running out of memory, so on regular basis we restart the server. When we restart, requests are hanged for several hours and triggered only for every 5 seconds. And rest are hanged and not working. After some hours, it works fine even with high load of 80 requests per second.

const query = JSON.stringify({
	'device_id': XXX,
	'items': YYY,
});

const options = {
	hostname: 'HOST',
	port: 443,
	path: 'Page Link',
	method: 'POST',
	headers: {
		'Connection': 'keep-alive',
		'Content-Type': 'application/json',
		'Content-Length': query.length
	}
};

var request = https.request(options, (res) => {
	res.on('data', (data) => {
		console.log('Response Data :: '+data);
	}).on('end', () => {});
	res.on('error', (e) => {
		console.error('Response :: '+e);
	});
});

request.on('error', (e) => {
	console.error('Request :: '+e);
});
request.write(query);
request.end();

We request to the same URL. Is there any problem in the implementation? Will our module save us from the problem we are into? Please do guide us.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions