Skip to content

Even if timeout occurs, the socket doesn't seem to get closed #29

Closed

Description

@kadishmal

Migrated from http://jira.cubrid.org/browse/APIS-603.

When the following code is executed with no specific timeout set, the timeout occurs after about 75 seconds, then the script exits immediately. That is the script exits as soon as the timeout occurs.

var CUBRID = require('../'),
        client = new CUBRID.createCUBRIDConnection('www.google.com', 33000, 'public', '', 'demodb');

client.connect(function (err) {
  if (err) {
    console.log(err);
  } else {
    throw 'We should not get here!';
  }
});

However, in the following code when we specifically set the timeout value to 5 seconds, the timeout correctly occurs after 5 seconds, but the script doesn't quit the next 70 seconds (total 75 seconds as before).

This is not correct. The socket should be closed and resources freed as soon as the timeout occurs as in the first example.

var CUBRID = require('../'),
        client = new CUBRID.createCUBRIDConnection('www.google.com', 33000, 'public', '', 'demodb');

client.setConnectionTimeout(5000);

client.connect(function (err) {
  if (err) {
    console.log(err);
  } else {
    throw 'We should not get here!';
  }
});

Activity

  1. self-assigned this
    on Feb 1, 2015
  2. added this to the v2.1.0 milestone on Feb 1, 2015
  3. kadishmal commented on Feb 1, 2015

    @kadishmal
    ContributorAuthor

    Fixed in v2.1.0 release.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions