PDA

View Full Version : [ubuntu] Binding a process to a port



ianbobisveck
May 19th, 2008, 08:59 AM
Hi.

I want to know if I can manually bind a process to a specific port. In effect, this would be kind of like internal port forwarding, where a "wrapper" process is between mine and the network:
my process (off port xxxx) --> wrapper (off port yyyy) --> network.

I mean, I *could* just change the source code and recompile, but if there is anything like what I am looking for it means I could run multipule instances of the same application, then 'bind' them to different ports via internal forwarding.

Any suggestions?

azadpanchi
July 25th, 2008, 11:51 PM
Most programs have configuration files associated with them, the best place to set this up would be in those configuration file.

If you have a real world scenario please update this post with that information. If this is a program you are writing I would suggest creating a config file which will not require you to recompile if you want to make any changes.

fnjordy
July 26th, 2008, 04:30 AM
That's a benefit of using (x)inetd (http://en.wikipedia.org/wiki/Inetd) but the application has to be written to work with it.