Running services remotely¶
You can run services remotely outside the Kanzi Connect Server process. For example, you can create a custom service and run it as a console application. See Tutorial: Create a custom Kanzi Connect service.
Kanzi Connect comes with remoteservicerunner
which serves as an example and is suitable only for development and testing.
Running a service library as a remote service¶
Kanzi Connect comes with a remoteservicerunner
executable that you can use to run shared library services.
To run a test service library that comes with Kanzi Connect:
Start the default debug Kanzi Connect Server
connect_server
Do not start the Kanzi Connect Server from a directory that contains the
service_test.dll
file. If you do, the Kanzi Connect Server loads that file and you cannot use the remote service runner.Note
Kanzi Connect installer stores the debug libraries in the PATH environment variable. With this setting executing connect_server starts the debug version of the server which is on Windows only capable of loading debug service libraries. If you want to execute the release binary of the Kanzi Connect Server, you must specify this explicitly by running the Kanzi Connect Server release version. For example,
<KanziConnectInstallation>/SDK/output/Win32/GL_vs2015_Release/connect_server.exe
.Start the service using the
remoteservicerunner
from the directory which contains the debug version of the service library.For example,
<KanziConnectInstallation>/SDK/output/Win32/GL_vs2015_Debug_DLL
.This way you tell the
remoteservicerunner
executable to load theservice_test.dll
library and connect to the Kanzi Connect Server running locally to provide the service.remoteservicerunner service_test.dll 127.0.0.1 2002
Customizing the remoteservicerunner
¶
Kanzi Connect installation includes the source code for the remoteservicerunner
. This way you can extend the functionality of the remoteservicerunner
. You can find the source code of the remoteservicerunner
in this Visual Studio project <KanziConnectInstallation>/SDK/examples/Server/Application/configs/platforms/win32/remoteservice.vcxproj
.
The remoteservicerunner
is implemented in the remoteservice.cpp
file.