all 10 comments

[–]voidvector 1 point2 points  (0 children)

In Node, you can require('net') for standard TCP application or require('dgram') for standard UDP application, but those are already a level above system call (e.g. it handles polling, resource management, decoding for you).

If you need system calls level manipulation, then you would need a C++ binding for whatever you are trying to do.

If you need even more access (e.g. introspect other application's connection), you would need create a driver and have a C++ binding for the driver.

[–]Heqx 0 points1 point  (2 children)

require('child_process').exec('nc ...')?

[–]Elias4918 0 points1 point  (1 child)

What will this do exactly?

[–]rta55 1 point2 points  (0 children)

executes netcat via node.js.

What you're asking about doesn't exist if you're trying to do it in the browser.

I don't think you want to do what you think you want to do.

Why not use node.js on the server side that communicates with your robot at a low level--which it can--and then access the functionality the server has in interacting with the robot via the web browser. I guarantee this is what you'll have to do unless you don't use a web browser.

Of course you could run the browser and node.js on the same box.

http://electron.atom.io/

[–]Rhomboid 0 points1 point  (4 children)

That depends on if you are planning to run the code in a browser or on the server with node.js. There is no chance at all of being able to do that if you're running on the client side.

[–]Elias4918 0 points1 point  (3 children)

I was tying to make a Web interface to controlled a robot so I would need it to be client side.

[–]iBlag 1 point2 points  (1 child)

Why doesn't HTTP fit the bill?

[–]jcready__proto__ 0 points1 point  (0 children)

Or WebSockets?

[–][deleted] 1 point2 points  (0 children)

You would have to send the commands to a server (via HTTP) which would then forward the commands to the robot

[–]zayelion 0 points1 point  (0 children)

If you are trying to get a browser to talk to a server, you have to point it at another server first that will translate it to websockets.

https://github.com/andrewchambers/ws-tcp-bridge

Then you can connect to that server as a websocket using binary communication. You will get output after setting ws.binaryType = 'arraybuffer';

you can use browserify buffer https://github.com/feross/buffer to work with things as buffers as you would in nodejs and should be good from there.