I
I
Ivan Pavlenko2018-03-19 21:28:13
Node.js
Ivan Pavlenko, 2018-03-19 21:28:13

How to keep client and server connection using UDP (dgram) on node.js?

As part of the study of working with the network, I want to understand how to organize the following using udp - the server waits for the client to connect and then they communicate until the moment of disconnection. Everything that I could find on this topic on the net comes down to examples from off-line documentation. where the client socket sends one message and then close is called. Sometimes there were examples describing the "message" method, which supposedly should receive data from the server, after which close =\ was usually called. The connection to the server, as I understand it, is carried out by calling the send command, where the address and port of the server are indicated, and the "message" method apparently should receive data in some magical way, this is usually not explicitly specified, I will assume that the connection uses the address and port data from send, but this is only an assumption.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question