#1 2017-01-24 22:19:01

DavidRM
Member
Registered: 2016-12-19
Posts: 29

How to Know When Server Setup is Finished?

I'm experimenting with a local/LAN client that detects the server not running and launches it in the background (just doing ShellExecute for now).

This works fine except in one case: The first time the server is run. (That is, when the server has to create databases and tables and what not.)

In that case, the server launches normally and seems to work. But when the client calls ServiceRegister, the server throws it back with a "routing not supported" exception. I can then close both client and server, and restart the client ... and the server launches and works fine. No exceptions when registering/using the interface.

I've tried forcing the client to wait after launching the server to give it time, but no length of time seems to make a difference.

So I'm curious if there is a flag I can check to know the server is ready for connections, and especially using interfaces.

Any thoughts?

-David

Last edited by DavidRM (2017-01-24 22:19:40)

Offline

#2 2017-01-25 05:59:41

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: How to Know When Server Setup is Finished?

Get the server's timestamp.

Then sleep (1000)...

Offline

#3 2017-01-25 14:33:45

DavidRM
Member
Registered: 2016-12-19
Posts: 29

Re: How to Know When Server Setup is Finished?

Unfortunately, that didn't work. No amount of sleeping seems to matter. I've put in hard waits for up to 30 seconds. I've even had the client disconnect from the server and reconnect, and I still get that "routing not supported" exception when the running client is the process that launched the server process.

Everything else seems to work, BTW. The client can set the user, even the admin user, and can retrieve data from the server. It just can't register that interface.

Does it matter that the interface is set to only be accessed by the admin user group? And/or that it is the only interface? I'll add another, less-restricted interface to the server and see if that makes a difference.

-David

Offline

#4 2017-01-25 16:09:45

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: How to Know When Server Setup is Finished?

I still don't understand why is there "routing not supported" on your server?
The HTTP server should be available instantly, but if you perfom some other tasks before launching the HTTP server, I guess.

Offline

#5 2017-01-25 16:16:40

DavidRM
Member
Registered: 2016-12-19
Posts: 29

Re: How to Know When Server Setup is Finished?

Now I'm getting that same error when I don't even use an HTTP server. I'm just creating the REST server in a stand-alone EXE.

Again, everything else works, just not the interface access.

Edited to add: And it works the same way. That is, on initial run with no database (so the database has to be created), there is an error attempting to access the interface. On subsequent runs, it works as expected.

-David

Last edited by DavidRM (2017-01-25 16:23:41)

Offline

#6 2017-01-25 18:43:40

DavidRM
Member
Registered: 2016-12-19
Posts: 29

Re: How to Know When Server Setup is Finished?

The issue, it seems, is me. smile

I should have paid more attention to the "authentication failure" part of the exception. I wasn't properly setting the admin user the first time through.

Thanks for your help, though.

-David

Offline

Board footer

Powered by FluxBB