I created a TCP Listener which keep on listening for the pending request on separate thread. If a client connected with server, each client is served on different thread. Initially I started using console application to start the Listener (Although it is not suitable, I used it for testing purpose). With console application and firewall on, Windows prompted me to allow access to the application. And later on the communication between client and server on different IP is successfull. Later I made my application as winservice. But now windows didn't prompted me to allow access. Now I couldn't able to communicate from different IP. Local host is working fine. Any help?
Asked
Active
Viewed 468 times
1
-
Windows won't be able to prompt you for access as services no longer are able to interact with the desktop. If you need elevated permissions, install the service as system, not the local user. Sounds like you'll still need to update the firewall. – Matt Davis Aug 02 '13 at 14:19
1 Answers
0
You need to add an entry to windows firewall to allow the incoming traffic. See http://technet.microsoft.com/en-us/library/cc753558.aspx
Edit:
netsh
is a command line utility to change network settings. To add firewall rule to accept traffic from everywhere to certain local port:
netsh advfirewall firewall add rule name="Rule name for future reference" dir=in action=allow protocol=tcp localport=12345 enable=yes profile=any "description=Description visible to the user"
To remove the rule:
netsh advfirewall firewall delete rule name="Rule name for future reference"
To run the script from MSI installer look at this question
-
It looks we need to manually set the inbound rule. Is that any way to do it while installing or atleast make the Windows to prompt for allow access dialog? @LRA – Prasanna B R Aug 02 '13 at 08:36
-
Firewall rule can be created during service install if you are using installer capable of calling command line. There is a command line utility for network management tasks: `netsh` – LRA Aug 02 '13 at 17:21
-
I'm using msi installer. I'm also not familiar with network management tasks: netsh. More descriptive guidance will be helpfull. @LRA – Prasanna B R Aug 06 '13 at 11:31