Allocate fixed port for program
I have written a program which uses port 5000. I need to restrict other programs use this port when I'm not running that program. In Linux are there a mechanism to restrict port 5000 accesses from other programs. Any idea please...
|
All you have to do is:
a) have your server bind to the port b) leave your server running PS: I'm oversimplifying a bit, but that's really pretty much all you have to do most of the time ... and it's usually sufficient. IMHO .. PSM PPS: If some other service happens to bind to your port first, you can easily identify the culprit with a tool like "lsof". |
Other options:
1. write a short dummy prog to bind to that port when the real one is offline 2. if root access; set an itpable rule to block that port when not running. |
All times are GMT -5. The time now is 04:17 PM. |