在Node.js的使用.NET的DLL /服务器端的JavaScript [英] Using a .NET DLL in Node.js / serverside javascript
问题描述
我有一个宠物项目,该项目是一个在线游戏,整个游戏引擎是用C#和我想知道是否有反正我可以利用内置的解决方案把这个现有的汇编文件(.dll)的功能Node.js的,Socket.IO,防爆preSS等?
I have a pet project that is an online game, the entire game engine is written in C# and I would like to know if there is anyway I can call the functions of this existing assembly (.dll) from a solution built using Node.JS, Socket.IO, Express etc?
游戏引擎本身是pretty齐全;测试和鲁棒性。我希望有没有太多的开销,暴露其功能的一些巧妙的方式。
The game engine itself is pretty complete; tested and robust. I am hoping there is some neat way of exposing its functionality without too much overhead.
更新
要回答我的问题有点..
我已经结束建设自己的网络套接字服务器(基于最新的网络套接字协议文件)。它是用C#编写并编译使用单声道,以便它可以在Linux机器上托管运行单,所以(有一些调整),我可以用我现有的游戏引擎。
To answer my own question a little.. I have ended building my own web socket server (based on the most current web socket protocol document). It is written in C# and compiled using Mono so that it can be hosted on a Linux box running mono and therefore (with a few tweaks) I can use my existing game engine.
更新2
我原本期待这不正是一个项目,现在已经存在 - http://tjanczuk.github.io/edge/#/
推荐答案
如果你想要做的就是旋转了一个轻量级的HTTP服务器,同时还具有C#编程和.Net你应该给Kayak的一个机会。这是C#一个轻量级的HTTP Server和行为有点像在这个意义上Node.js的。
If all you want to do is spin up a lightweight HTTP server while still programming with C# and .Net you should give Kayak a chance. It is a lightweight HTTP Server for C# and behaves kind of like node.js in that sense.
更新:
如果你正在寻找一个轻量级的HTTP服务器来处理Web请求,你有一对夫妇的选择今天:
If you are looking for a lightweight HTTP Server to handle web requests you have a couple alternatives today:
- ServiceStack(推荐)
- 微软的WebAPI
- NancyFx
据我所知,一些版本的单上述所有工作,所以你仍然可以承载他们基于跨越Windows和Unix系统。
To my knowledge all the above work on some version of Mono, so you can still host them across both Windows and Unix based systems.
这篇关于在Node.js的使用.NET的DLL /服务器端的JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!