- 
                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 4 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,8 +1,10 @@ | ||
| // 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; | ||
|  | ||
|  | @@ -20,10 +22,10 @@ HelloServiceI::start( | |
| const shared_ptr<Ice::Communicator>& communicator, | ||
| const Ice::StringSeq& /*args*/) | ||
| { | ||
|         
                  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,42 @@ | ||
| This demo shows how to create an [IceBox][1] service. | ||
| # IceBox Hello | ||
|  | ||
| This demo shows how to create an [IceBox][1] service. | ||
|  | ||
| ```shell | ||
| cmake -B build | ||
| cmake --build build --config Release | ||
| ``` | ||
|  | ||
| To run this demo, open two terminal windows. In the first window, | ||
| start the IceBox server: | ||
| start the IceBox server from the directory containing the `HelloService` library: | ||
|  | ||
| **Linux/macOS:** | ||
|          | ||
|  | ||
| ```shell | ||
| icebox --IceBox.Service.Hello="./build/HelloService:create" | ||
| ``` | ||
| icebox --Ice.Config=config.icebox | ||
|  | ||
| **Windows:** | ||
|  | ||
| ```shell | ||
| icebox --IceBox.Service.Hello="./build/Release/HelloService:create" | ||
| ``` | ||
|  | ||
| In the second window, run the client: | ||
| ``` | ||
| client | ||
| ``` | ||
|  | ||
| To shut down IceBox, use `iceboxadmin`: | ||
| **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.