N
N
nastya_guk2020-09-19 06:45:26
Python
nastya_guk, 2020-09-19 06:45:26

Is it possible to monitor a port through python, close it and open it as needed?

Good afternoon.
A program on computers under windows uses port 4206 to connect, for example, this is an RMS program
That is, when RMS is running on a computer, but there is no connection with the client, port 4206 just hangs open? I understand correctly? Is it possible to somehow understand that a connection has been made and it is active now, for example through python, and for example, play a sound?
If you close port 4206 while the connection is active, will the connection stop?
How to close the port and open as needed?
I will also be grateful if you advise materials on networks, preferably in Russian.
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HemulGM, 2020-09-19
@HemulGM

The port does not have an open/closed state.
This is a convention. An open port means accessible from the outside. This is managed by the firewall (firewall).
By default, all ports (except system ports) are closed. Moreover, there is no danger in an open port, because an attempt to connect even through an "open" port will not lead to anything. There will simply be no response (if the software is not running).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question