Windows Service Installer using Sockets

  • Thread starter Thread starter kshetgar
  • Start date Start date
K

kshetgar

I am experiencing a wierd problem...

I have a C#.Net application Server which uses Sockets.
It listens on port 11000. and it runs as a Windows Service.


If I run it as a consple Application, I can connect to that
port/Application from any machine on the network as well as from my
local machine.

BUT If i install it as a Windows Service, I cannot connect to it from
the network though it works just fine form the local machine.

And one more strange issue, If I install it using the InstallUtil.exe,
it works fine ! That is I can connect to that port/Application from any
machine on the network as well as from my local machine.

So there must be something on the Windows Installer. Either I am
missing a configuration property or
Windows Installer doesnt go well with sockets at least in assigining
permissions ..I dont know.

Can anyone help me out...I have spent enough time searching for it on
the web.

FYI: I have tried service running under Local Service/Local System/ and
also under Administrator account..but no luck.
 
Hi,


Under what user you are running the service?
Are you getting any exception?
Do you have any firewall installed?
 
I have tried it under all the users, I have tried it under my windows
account which belongs Admin group. and also under Local Service and
Local System account.

I dont have firewall installed.

As I said before, Strange thing is it works when it is running as
Console App or running as Service when installed through
InstallUtil.Exe. but it doesnt work if it is installed through Windows
Installer.
 
Hi,

Weird, Are you getting any exception?

How is that you are creating your installer?
 
|I am experiencing a wierd problem...
|
| I have a C#.Net application Server which uses Sockets.
| It listens on port 11000. and it runs as a Windows Service.
|
|
| If I run it as a consple Application, I can connect to that
| port/Application from any machine on the network as well as from my
| local machine.
|
| BUT If i install it as a Windows Service, I cannot connect to it from
| the network though it works just fine form the local machine.
|
| And one more strange issue, If I install it using the InstallUtil.exe,
| it works fine ! That is I can connect to that port/Application from any
| machine on the network as well as from my local machine.
|
| So there must be something on the Windows Installer. Either I am
| missing a configuration property or
| Windows Installer doesnt go well with sockets at least in assigining
| permissions ..I dont know.
|
| Can anyone help me out...I have spent enough time searching for it on
| the web.
|
| FYI: I have tried service running under Local Service/Local System/ and
| also under Administrator account..but no luck.
|

Are you sure that your Service is implemented correctly? That is do, you
create a thread in "OnStart" to run your service? Show us your code or part
of...

Willy.
 
Thanks for the replies....

Well..
I can run the same Installer on my local machine and it works perfectly
fine.
That is:

1 If I install it on my local machine, and try to connect to it from my
local machine, I can connect to it,
But I cant connect to it from other machine in the network.

One more thing I have found is:

It doesnt happen on all the machines. This installer works on some
machines. but not on all.
We tried to install it on few test machines and only one of them
failed.


2. If I run it as Console App OR Install it using InstallUtil.exe It
works fine, that is I can connect to it from local
machine as well as from the network.
( This is also true for the Test machine, on which it had failed, I
reinstalled it using InstallUtil.exe and it works !!)

It is something in the System Settings OR Installer settings which is
not allowing the network to open the port on this machine, if
it is installed as a Windows Service.

If you still want me to post relevent Code, I will. Let me know which
section you would think is probable culprit.

Thanks

--Kumar Shetgar
 
Hi,


It doesnt happen on all the machines. This installer works on some
machines. but not on all.
We tried to install it on few test machines and only one of them
failed.

I still think you have a firewall running, did you check:

1- XP with SP2 in the security center that the firewall is off?
2- In the TCP/IP property of the local network check the TCP/IP filtering
3- In the local network connection check the advance tab and see what is in
the windows firewall


Check antivirus, etc that can being protecting the computer
disable the firewall service from the windows services
 
If it is a firewall, a simple test would be to use telnet to connect.

Start > Run > command
or
Start > Run > cmd

Then from the DOS window type: Telnet IP Port

Example: Telnet 192.168.1.5 11000

If you get refused then its a firewall.

Hope this helps,
Dan
 
Thanks guys,

I used telnet command But It refused to connect.

My question is:
Why I cant connect to the Service on that port when it is installed
using WIndows Installer. When I install it using the InstallUtil.exe, I
can successfully connect to the Service on that port. If it is a
firewall issue, shouldnt it block the communication even when it is
installed using InstallUtil.exe ?
 
Some More Clarification:

When I said " I used telnet command But It refused to connect.", Its
only in the case when I install it using the Windows Installer.
If I install it using the InstallUtil.exe Telnet Command Works just
fine.

My question is:

Why I cant connect to the Service on that port when it is installed
using WIndows Installer. When I install it using the InstallUtil.exe, I

can successfully connect to the Service on that port. If it is a
firewall issue, shouldnt it block the communication even when it is
installed using InstallUtil.exe ?
 
Thanks guys,

It was firewall problem.
Earlier to turn the firewall off, I opened the firewall properties, and
checked 'off'.
And I always thought that this made the firewall off.
But No....That doesnt make the firewall off...as long as the Windows
Firewall Service is running.
When I stopped this service, my program works.
huh.!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top