Skip to content

Add timeout to COM initialization #141

Description

@SimonFischer04

Hi,
Thanks for the great project.

I'm using this package to communicate with a device-driver. In my logic I'm calling (default settings from readme):

var winax = require('winax');

console.log('a')
const device = new winax.Object('somedevice.comif', {
        activate: false,
        getobject: false,
        type: true
      });
console.log('b')

If the driver is running everything is fine. But if not, it just hangs my program indefinitely (prints a, but never b).
(ps: the 'somedevice.comif' is correct, because if I put in some random value I get a proper error that a class with this name does not exist)
I don't know if it's a Problem with the driver I'm using (more likely, but unfortunately I have no control over this one) or with this package.

Would be great if the COM initialization could be made asynchronous, or I'm able to pass some 'timeout' option to the constructor call, so I can deal with this and not just stuck my whole application.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions