NetTalk Central

Author Topic: TCP/IP not working from within service  (Read 4483 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
TCP/IP not working from within service
« on: April 20, 2016, 05:01:57 AM »
Hi,

I have a server app that normally runs as a service using SelfService. My client app normally connects with the server app using NetSimple - to see what's running on the server. When it's running as a service now, the client app can't connect any more - but when the server app is running on the desktop it can connect perfectly. In the server app there are no errors reported in the NetSimple.ErrorTrap method. Any ideas where I can look to solve the problem?

Using NT 8.71 and C10.

Thanks,
Thys

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: TCP/IP not working from within service
« Reply #1 on: April 20, 2016, 10:56:06 AM »
By using the Client option in the NetDemo app, I confirmed that the TCP/IP works correctly when the service app runs on the desktop. But the Client demo can't connect when it runs as a service. So the problem is not with my own client app.

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: TCP/IP not working from within service
« Reply #2 on: April 20, 2016, 11:29:21 AM »
Thys, check the service account is used to run the service. Maybe the server have some restrictions to the System Account, to prevent to connect outside the network or use the network services at all.

Try using another account in he server (local account etc) and see if it works

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: TCP/IP not working from within service
« Reply #3 on: April 20, 2016, 09:39:42 PM »
We're very aware of the permissions allocated to the service account. I did a quick change to another account without improvement. But the service is actually running - the processing it does happens normally. It really seems to be only TCP/IP (and hence HTTP as well) not to work.

Thanks

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: TCP/IP not working from within service
« Reply #4 on: April 21, 2016, 05:05:53 AM »
I used TCPView from SysInternals to look at the TCP server processes. When run on the desktop, the local address for my app is correct as configured (127.0.0.1). But when run as a service, although the Open method is called with 127.0.0.1, it defaults to 169.254.16.178?

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: TCP/IP not working from within service
« Reply #5 on: April 21, 2016, 10:25:36 PM »
I found the source of the problem, but not a way to solve it.

In the very first lines of code of the main module, the Self Service object sets the values of ServiceName, DisplayName and Description. The Self Service template allows you to define variables that are assigned to these properties for when the service is registered. In this case, I want the properties to use values from SQL, so before the Self Service properties are set, I added code in the global embed "Self Service - Initialize Varaibles" to read data from SQL. In here, I open a window with an OLE container to read SQL data using ADO. When I hardcode the results and don't do it through the window, the TCP/IP works. I also removed the OLE container and still open the window - not successful. Seems like the Clarion window that is opened first thing in the app causes the TCP/IP not to open.

Thys