Edge: how can i hold node object in .net CLR?

Created on 28 Nov 2017  路  3Comments  路  Source: tjanczuk/edge

how can i hold node object in .net CLR,impossible?

All 3 comments

Hello World!

@tjanczuk i need your help,i want to save a object of node.js in my c# code,do you have Any good ideas?thank you so much!

````
var getCam = Edge.Func(@"

            var Cam = require('onvif').Cam;

            return function (data, callback) {

                new Cam({
                    hostname: '{0}',
                    username: '{1}',
                    password: '{2}',
                    port: {3}
                }, function (err) {
                    if (err) {
                        callback(err);
                    }

                    callback(null,this);
                });
            };
        ".Replace("{0}", CAMERA_HOST).Replace("{1}", USERNAME).Replace("{2}", PASSWORD).Replace("{3}", PORT));


        var cam = await getCam(null);


        var func = Edge.Func(@"


            return function (cam, callback) {

                cam.getStreamUri({ protocol: 'RTSP' }, function (err, stream) {

                        callback(err, stream.uri);
                });
            };
        ".Replace("{0}", CAMERA_HOST).Replace("{1}", USERNAME).Replace("{2}", PASSWORD).Replace("{3}", PORT));

        var uri = await func(cam);

````
I want to hold the cam object in my c# code,
somebody have any good ideas?
thanks~

Was this page helpful?
0 / 5 - 0 ratings

Related issues

node2013 picture node2013  路  3Comments

kneumei picture kneumei  路  10Comments

harivasista picture harivasista  路  5Comments

keyiis picture keyiis  路  3Comments

agracio picture agracio  路  6Comments