L
L
lem_prod2016-02-26 12:17:12
Computer networks
lem_prod, 2016-02-26 12:17:12

What is netsocket?

Explain in detail what is instance no socket? From the literature on networks, I concluded that a socket is just a pair of ip \ port, is that so?
What does it mean to write to a socket or read from a socket? Does the socket exist outside the server? Or is the socket in the node an event emitter like a server...?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2016-02-26
@bingo347

in node.js, the net module implements the tcp, upd and unixsock protocols,
it is this module that allows the node to create various servers, as well as connect to other servers , the
http module, for example, is written as a wrapper over the net module that implements the http protocol (which works on top of tcp)
The class itself socket inherits from stream.Duplex

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question