Using edge.js is it possible for the .Net C# module to call the node.js part of the process, i.e. do the reverse call?

牧云@^-^@ 提交于 2019-12-14 01:01:35

问题


You can see the interop model for going from Node.js -> C#, here.

What I want to know is, can the C# code then make a call to a method in the Node.js part of the process from the C#, before returning?

Imagine if you had a call, like

var webApi = edge.func('/MyDotNetApi.csx');
webApi(function (error, result) { log.('api started'); });

where the MyDotNetApi.csx returns, but leaves a socket listener thread running to handle HTTP requests. Now, if the Node.js part of the process holds (ever changing) information which the .Net code needs to access for inclusion in its HTTP responses, can it somehow ask Node.js for it?


回答1:


Calling back Node.js from C# with Edge.js is possible and documented.



来源:https://stackoverflow.com/questions/18861687/using-edge-js-is-it-possible-for-the-net-c-sharp-module-to-call-the-node-js-par

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!