views:

259

answers:

4

hi, i have a windows service written in delphi

A: 

Check the access rights of the user the service runs under.

By default it is LocalSystem, which may not be allowed to access remote networks (i.e the Internet). Try running it under the same user you logged in as.

Hope this helps

Binary Worrier
thx but i said that it will work properly in another pc under the local system
sam
my pc use a shared connection to access to the internet
sam
sam
innerExeption :System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:9666 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean
sam
is it possible that the service can't use the shared connection to access to internet ? i know the windows service under the local system account can use shared connection to access to internet like sending email
sam
??? Using what? MAPI or SMTP? I believe it's MAPI, because SMTP would need to create an direct connection to the network (direct = under Local System account).
Fabricio Araujo
i use wininet dll to download, i know with smpt it will work on local system
sam
+3  A: 

Normaly, under LocalSystem, a service can't access network resources. You said it works with another PC, I can't explain why. You said it works in another application, yes, because application is executed with current account.

The solution may be to execute the service under the Network Serviceaccount. Check it to see if it fixes the issue !

TridenT
If so most server application wouldn't work.
ldsandon
+1  A: 

Services cannot access Network Resources, such as via UNC paths, without additional access rights applied. But a service has unrestricted access to use TCP and UDP sockets. I've written several services that connect to remote servers via TCP/IP and they work fine without extra configurations or access rights needed.

Remy Lebeau - TeamB
A: 

You can use a tool like Wireshark to capture and check the HTTP session, and understand if it is an issue at the transport level or something else.

ldsandon