-
Notifications
You must be signed in to change notification settings - Fork 216
Add IceBox CMake files #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
acfc4bc
3970d3f
06e1c50
4b63058
4741c51
004a968
f7aa0ec
1526a4f
6517e9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| cmake_minimum_required(VERSION 3.16) | ||
|
|
||
| project(icebox_hello CXX) | ||
|
|
||
| include(../../cmake/common.cmake) | ||
|
|
||
| add_executable(client Client.cpp Hello.ice) | ||
| slice2cpp_generate(client) | ||
| target_link_libraries(client Ice::Ice) | ||
|
|
||
| add_library(HelloService SHARED HelloI.cpp HelloI.h HelloServiceI.cpp HelloServiceI.h Hello.ice) | ||
| slice2cpp_generate(HelloService) | ||
| target_link_libraries(HelloService Ice::Ice Ice::IceBox) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,29 @@ | ||
| // Copyright (c) ZeroC, Inc. | ||
|
|
||
| #include <HelloI.h> | ||
| #include <HelloServiceI.h> | ||
| #include "HelloServiceI.h" | ||
| #include "HelloI.h" | ||
|
|
||
| #include <Ice/Ice.h> | ||
|
|
||
| #include <iostream> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest adding a blank like between Ice/IceStorm etc. headers and other system headers. |
||
|
|
||
| using namespace std; | ||
|
|
||
| extern "C" | ||
| { | ||
| // | ||
| // Factory function | ||
| // | ||
| ICE_DECLSPEC_EXPORT IceBox::Service* create(const shared_ptr<Ice::Communicator>&) { return new HelloServiceI; } | ||
| ICE_DECLSPEC_EXPORT IceBox::Service* create(const Ice::CommunicatorPtr&) { return new HelloServiceI; } | ||
| } | ||
|
|
||
| void | ||
| HelloServiceI::start( | ||
| const string& name, | ||
| const shared_ptr<Ice::Communicator>& communicator, | ||
| const Ice::StringSeq& /*args*/) | ||
| HelloServiceI::start(const string& name, const Ice::CommunicatorPtr& communicator, const Ice::StringSeq&) | ||
| { | ||
externl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| _adapter = communicator->createObjectAdapter(name); | ||
| auto hello = make_shared<HelloI>(); | ||
| _adapter->add(hello, Ice::stringToIdentity("hello")); | ||
| _adapter = communicator->createObjectAdapterWithEndpoints("Hello", "tcp -p 10000:udp -p 10000"); | ||
externl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| _adapter->add(make_shared<HelloI>(), Ice::stringToIdentity("hello")); | ||
| _adapter->activate(); | ||
| cout << "Listening on port 10000..." << endl; | ||
| } | ||
|
|
||
| void | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,48 @@ | ||
| This demo shows how to create an [IceBox][1] service. | ||
| # IceBox Hello | ||
|
|
||
| To run this demo, open two terminal windows. In the first window, | ||
| start the IceBox server: | ||
| This demo shows how to create an [IceBox][1] service. | ||
|
|
||
| ```shell | ||
| cmake -B build | ||
| cmake --build build --config Release | ||
| ``` | ||
| icebox --Ice.Config=config.icebox | ||
|
|
||
| To run this demo, open two terminal windows. In the first window: | ||
|
|
||
| **Linux:** | ||
|
|
||
| ```shell | ||
| LD_LIBRARY_PATH=./build icebox --IceBox.Service.Hello="HelloService:create --Ice.Trace.Dispatch" | ||
| ``` | ||
|
|
||
| In the second window, run the client: | ||
| **macOS:** | ||
|
|
||
| ```shell | ||
| DYLD_LIBRARY_PATH=./build icebox --IceBox.Service.Hello="HelloService:create --Ice.Trace.Dispatch" | ||
| ``` | ||
| client | ||
|
|
||
| **Windows:** | ||
|
|
||
| ```shell | ||
| set PATH=%PATH%;./build/Release | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would not use '/' in a Windows PATH. Does it actually work? |
||
| icebox --IceBox.Service.Hello="HelloService:create --Ice.Trace.Dispatch" | ||
| ``` | ||
|
|
||
| To shut down IceBox, use `iceboxadmin`: | ||
| In the second window, run the client: | ||
|
|
||
| **Linux/macOS:** | ||
|
|
||
| ```shell | ||
| ./build/client | ||
| ``` | ||
| iceboxadmin --Ice.Config=config.admin shutdown | ||
|
|
||
| **Windows:** | ||
|
|
||
| ```shell | ||
| build\Release\client | ||
| ``` | ||
|
|
||
| Linux 32-bit | ||
| ------------ | ||
| ## Linux 32-bit | ||
externl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| If you are using 32-bit binaries on a Linux 64-bit host, use | ||
| `icebox32` instead of `icebox` to start the IceBox server. | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should further simplify in a follow up PR and have IceBox/greeter, inline with
Ice/greeter.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could though we'll have to figure out what the behavior will be.