I am looking for a way to set up a listener on a linux machine that will listen to a port, such as port 8000, for incoming communication, and then execute a .bat file if the incoming communication indicates to do so.
This program would have to run from the startup of the machine till shutdown and would require to be as efficient as possible because one of the commands in the .bat file would be to run another C program(which gets very complicated to explain so please trust me on the part that the second C program needs to be run by the .bat file)
OS: Linux Kernel
Code examples, if possible, would be greatly appreciated as well as any suggestions or solutions.
Note: I know that the .bat should be .sh on linux, just force of habbit to use .bat, but they work