Connections to socket with Nodejs - node.js

I need to create Nodejs aplication that will connect to several devices using net-snmp, just one server connecting to 300 devices.
But i don't know if is a good idea to use NodeJS.
I started using NodeJS a short time ago.

From the documentary i dont think that should be done with NodeJS since its said on the Agent Architechture
It usually interacts with libraries, the network, plugins, other
processes, the file system, the local OS, and the local OS's kernel.

Related

What would be the recommended way to exchange data from a WebGL application running on a Raspberry Pi to write to the Pi's serial interface?

Here's the full problem:
I have a WebGL build of a Unity project running on a Pi, and I need the data from this process written to the Pi's serial interface (and vice versa). The best possible solution I can think of is hosting the WebGL server using Express, and utilizing nodejs for the backend process of somehow running some python code that works the serial interface. Problem is, I'm super inexperienced with these platforms and I don't have enough familiarity with how they all work together to intuitively feel out what to do. Hoping I can get some guidance on any recommended paths.
Pre answered questions:
Unity project on a Pi?: I have a simulation running in Unity, and I need it running on a lightweight computing platform. The only way to run this on a Pi is in a WebGL build.
What are you trying to achieve?: I'm trying to achieve a communication pipeline with this WebGL process and an Arduino, specifically over serial.
What I've tried:
I've tried running the WebGL process utilizing systems like Banyan, which would allow communication with a server, but it seems the WebGL build does not allow sockets.
I've tried hosting the server using Express through nodejs, and the app does actually work, I just need help understanding how this system works such that I can exchange data from the WebGL app and a python script that is running the serial comms. As stated above, I'm very new to the nodejs system so I may not even be using the nomenclature properly.

how to communicate with my apps using IP address and socket remotely

I am to Electron and nodejs
And stuck here, actually i m making a desktop app to control every PC in network. which tells me the ip and mac of computers in the network. But now I need to talk to it and push/get some message. but how ?
Socket.io is likely the easiest way to do what you are trying to do. It'll allow you to communicate between the machines with a relatively low amount of effort.
Sockets generally work on a "server" and "client" basis, so you may want a central server that will coordinate with the clients.
This blog post from node source provides a really good intro to using them.

RPC from Windows to linux

Is there some (working) example how to create RPC from windows to linux?
Client should be windows NT application, server is linux.
It needs to be MSRPC.
No Corba, no XML-RPC, SUN-RPC etc
MSDN says this:
RPC can be used in all client/server applications based on Windows
operating systems. It can also be used to create client and server
programs for heterogeneous network environments that include such
operating systems as Unix and Apple.
Unfortunately after spending few hours on google I'm giving up.
My expectation:
Linux node should have samba installed, because their MSRPC implementation works.
Using IDL file I generate stubs for both client and server
Client is built using MSVC
Server is build using gcc with some includes/libraries from samba (or other libs)
Linux node must have such RPC port mapper
Can someone point me out?
I think you have 2 possible ways to deal with this:
1- You can try using DCOM with wine, which means that you will actually write your code for windows, but at the same time you can test your results in the process and avoid using WinAPI calls that wine is not able to handle properly. This approach will allow you to generate stubs code from your IDL files.
2- You can try using Samba RPC Pluggable Modules, but I am afraid in this case the RPC communication will be more primitive.
Edit:
It seems there are many other ways. I found a list of libraries in DCOM-Wikipedia, j-Interop for example looks particularly promising.

Implementing a kernel debugging module for a Linux guest OS inside a VmWare VM

Sorry for the rather long post.
I need some input regarding a project that I am going to undertake.
I am trying to make an application that collects kernel debugging information from a guest Linux OS, located inside a VmWare Virtual Machine, and send them to a host OS efficiently.
So far, I have found a similar project, but written for Windows[1].
The author of the project wrote a DLL that is loaded into memory, and replaces the implementation of the KdSendPacket and KdReceivePacket functions, to use the VmWare GuestRpc[2] mechanism, instead of the slow serial port.
The data are then send to a debugging application on the host(Kd or WinDbg) trough a named pipe.
The author claims that there is a speed-up up to 45%, by avoiding the serial port transmission.
I am trying to achieve something similar ,but for Linux, and try to make the debugging process a little faster, than using the serial port.
My concrete questions are :
Do any similar applications exist?
I didn't manage to find any.
Would such an application be worth it ,comparing its functionality to netconsole[3], for example?
What method of intercepting printk messages would you suggest ?
Is there an equivalent of KdSendPacket/KdReceivePacket on Linux ?
[1]. http://virtualkd.sysprogs.org/dox/operation.html
[2]. http://articles.sysprogs.org/kdvmware/guestrpc.shtml
[3]. http://www.kernel.org/doc/Documentation/networking/netconsole.txt
Using the serial port is really suboptimal.. even the (virtual) network would be preferable to that, but getting back to host-guest IPC channels, VMware's VMCI comes to mind.
many approaches can use to achieve your goal, below methods can be applied if network is connected:
use syslog service and transfer log though network to your server:
syslogd, syslogng seems support sending log to a log server with some filter critiera.
directly call tcp/udp socket functions in your kernel module to sends your collected data back to server.
other approaches, you may write application on host machine that calls hypervisor's share memory access function to read the memory buffer of your kernel module. However, the xen/kvm hypervisor both support these apis and i am not sure about weather vmware have this kind of library.

Listening a particular port on linux to access data comes from mobile device

i am newbie to Linux platform, i am working on java technology.
what i have to do is : Having a program that running on mobile devices,that sends some data to my Linux machine, now i have to create a program in java that
listen to a particular port.
access data comes on that port(which is sending by mobile device)
save that data to the database.
response back to the mobile device.
i.e. i would make my Linux system as server that can listen from many clients(mobile devices), but not getting how to configure this environment... :(
i used cent OS 5.4 and
installed jdk1.6.0_24
any help would be appreciated.....
thanx in advance!
khushi
One of Java's greatest strengths is that you can pretty much ignore the host operating system as long as you stick to core Java features. In the case you're describing, you should be able to accomplish everything by simply using the standard Java networking APIs and either the JDBC to access an existing, external database or you could choose any number of embedded Java databases such as Derby. For your stated use case, that you'll be running the application on Linux is pretty much irrelevant (which should be good news... you don't need to learn a whole operating system in addition to writing your app ;-).
Here's a nice client/server tutorial, in that it is broken into steps, and adds each new concept in another step.
Here's another client/server tutorial with much more detail.
I would write it to accept one connection at a time. Once that works, I would study the new(ish) java.lang.concurrent classes, in particular the ExecutorService, as a way of managing the worker bee handling each connection. Then change your program to handle multiple connections using those classes. Breaking it up in two steps like that will be a lot easier.

Resources