A
A
Alexey Yarkov2016-01-19 21:44:38
Python
Alexey Yarkov, 2016-01-19 21:44:38

What is the best way to find a server on a local network?

I am writing a client-server, in advance the IP of the computer on which the server will be unknown. Tell me the best way to find a computer in LAN that has a program hanging on a specific port.
Only one thing comes to mind: iterate through the range of possible IPs and try to connect to the port. Maybe there is an intelligent solution?
P.S.Python.
PS I do not ask for the code. Prompt the algorithm.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Skogorev, 2016-01-19
@yarkov

Broadcast?

V
Vladimir, 2016-01-20
@vintello

we get our ip
> ip addr show
, for example, we got 192.168.0.101
, then we scan the grid for the presence of computers on the network
> nmap -sP
192.168
. says, but should work guaranteed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question