Answer the question
In order to leave comments, you need to log in
How to send and receive a packet transmitted via a broadcast IP address?
I have an application (not yet written) designed to transfer files over a local network (similar to AirDrop in functionality). In order for the program to understand which IPs can be used to transfer files, it was decided to send a request to the broadcast IP address of the network / subnet so that all "compatible" PCs would respond to it, because pinging all busy IPs on the network is dull and long (tell me if this is crazy and an unsafe idea).
Now the main question: how to send and receive a packet transmitted through a broadcast IP address? i am using node js and tcp/ip protocol. thank you in advance.
Answer the question
In order to leave comments, you need to log in
1) You invented Zeroconf / uPnP Take a pie from the rack
2) SENSATION!!!111 , TCP worked on the broadcast port (no).
Before making great discoveries in the field of networks, study the theory, at least Sneijder and Olifer.
After studying the work of atts, the desire to sculpt bicycles fades away and is replaced either by the competent use of the available functionality that generations of programmers have already managed to set up before you, or by a balanced and clear decision without cruel mistakes like TCP on the broadcast port.
To broadcast something, you need UDP . To understand where you are sending what, obviously, you will need to invent some kind of your own method for identifying machines, for example, by name.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question