bhuvan_reddy
asked on
registering a port for my application
Hi,
I am developing a windows application (c#.NET) and it should use two ports for communication.
Is there any way to reserve two ports for my application permenetly ,i mean even if my application is not in use those two ports should not be used by anyother applications.
Do i need to update any registry variable.
I am developing a windows application (c#.NET) and it should use two ports for communication.
Is there any way to reserve two ports for my application permenetly ,i mean even if my application is not in use those two ports should not be used by anyother applications.
Do i need to update any registry variable.
ASKER
Hi ptupapers,
Thanks for the info but if i do the above method it only restricts the applications which requests for random port numbers but if any application specifically requests the ports which are reserved by my application then they can also use the ports. I don't want that to happen.
is there any way to register the ports only for my application
example:
if b.exe is my application then is there any way that i can tell to system to register some ports only to b.exe so tht no other application can register.
Thanks for the info but if i do the above method it only restricts the applications which requests for random port numbers but if any application specifically requests the ports which are reserved by my application then they can also use the ports. I don't want that to happen.
is there any way to register the ports only for my application
example:
if b.exe is my application then is there any way that i can tell to system to register some ports only to b.exe so tht no other application can register.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You just need to create a new multi-string-value inside registry HKEY_LOCAL_MACHINE\SYSTEM\
When your application starts, you need to delete the value so that the port become unreserved and your apllication could use it.
Before exiting create the same key again.
more info Here :
http://support.microsoft.com/kb/812873