3 ms·
A Very Simple Network Connection with Node.js
- mtdewcmu 13y ago>> I'm not a TCP expert, but apparently the closing initiator (the client in our case) should wait for acknowledgement from the other side of the connection before dying off, see Wikipedia link above. So, I set process.exit() to run as a callback on the close event of the client object. This highlights one of the problems with node. You can be doing the simplest thing and find yourself needing to deal with low-level details of TCP to make it work properly. Now that node has shown what's possible, I think there's an opportunity to do it better with fewer pain points.
- xhrpost 13y agoI'm not a C expert either but a lot of the system modules in Node appear to be simple JavaScript wrappers over their C counter-parts. I'm not sure if this is necessarily a problem but rather the developers just didn't aim for a higher level of abstraction. I think they aimed for OS abstraction and stopped there for some of the modules.
- mtdewcmu 13y agoI definitely got the feeling from toying with node that you're working at a very low level, basically interfacing with system calls. There's not necessarily anything wrong with that, but you have to understand that in order to know what you're doing. It's a curious experience to be using javascript on the one hand, and be doing extremely low-level systems programming on the other. It would be useful to have better documentation on exactly what those node functions do when you call them.