![]() ![]() Thread-based networking is relatively inefficient and veryĭifficult to use. This is in contrast to today's more common concurrency model, in which OS threadsĪre employed. const http = require ( 'http' ) const hostname = '127.0.0.1' const port = 3000 const server = http. Upon each connection, the callback isįired, but if there is no work to be done, Node.js will sleep. In the following "hello world" example, manyĬonnections can be handled concurrently. As an asynchronous event-driven JavaScript runtime, Node.js is designed to build ![]()
0 Comments
Leave a Reply. |