Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,15 @@ jobs:
with:
path: ice-demos

- name: Generate C++ Build Systems on ${{ matrix.os }}
timeout-minutes: 5
working-directory: ice-demos/cpp
run: find . -name CMakeLists.txt -execdir cmake -B build -S . ";"

- name: Build C++ Demos on ${{ matrix.os }}
uses: ./ice/.github/actions/build
timeout-minutes: 20
with:
working_directory: ice-demos/cpp
msbuild_project: msbuild/ice.proj

- name: Build C++ Demos on ${{ matrix.os }} with CMake
timeout-minutes: 5
working-directory: ice-demos/cpp
run:
find . -name CMakeLists.txt -execdir cmake -B build -S . \; -execdir cmake --build build --config Release \;
run: find . -name CMakeLists.txt -type d -execdir cmake --build build ";"

- name: Build C# Demos on ${{ matrix.os }}
timeout-minutes: 20
Expand Down
63 changes: 3 additions & 60 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,68 +1,11 @@
# Ignore executables
client
server
locator
publisher
subscriber
reader
writer
talk
chatserver
chatgl2client
chatpollclient

!**/Chat/client/
!**/Chat/server/

!**/msbuild/client
!**/msbuild/server
!**/msbuild/locator
!**/msbuild/publisher
!**/msbuild/subscriber
!**/msbuild/reader
!**/msbuild/writer

!**/Sources/client
!**/Sources/server
!**/Sources/locator
!**/Sources/publisher
!**/Sources/subscriber
# Cmake generated files
build

.gradle
*.jar

# Ignore objects and archives.
*.[oa]
*.obj
*.dll
*.ilk
*.so
*.so.*
*.sl
*.dylib
*.pyc
*.class
*.exe
*.mdb
*.pdb
*.tds
*.bak
*.ncb
# .sdf is the Visual Studio 2010 equivalent to .ncb
*.sdf
*.opt
*.opendb
*.res
*.exp
.gdb_history
# macOS Finder
.DS_Store
core
/*/dist
generated
build
generated.test
cgenerated
sgenerated

# Eclipse
.externalToolBuilders
Expand Down
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,24 @@
"C_Cpp.default.cppStandard": "c++17",
"gradle.nestedProjects": true,
"cmake.sourceDirectory":[
"${workspaceFolder}/cpp/Ice/bidir",
"${workspaceFolder}/cpp/Ice/callback",
"${workspaceFolder}/cpp/Ice/context",
"${workspaceFolder}/cpp/Ice/greeter",
"${workspaceFolder}/cpp/Ice/greeterAsync",
"${workspaceFolder}/cpp/Ice/interceptor",
"${workspaceFolder}/cpp/Ice/interleaved",
"${workspaceFolder}/cpp/Ice/invoke",
"${workspaceFolder}/cpp/Ice/latency",
"${workspaceFolder}/cpp/Ice/locator",
"${workspaceFolder}/cpp/Ice/mtalk",
"${workspaceFolder}/cpp/Ice/multicast",
"${workspaceFolder}/cpp/Ice/nested",
"${workspaceFolder}/cpp/Ice/optional",
"${workspaceFolder}/cpp/Ice/properties",
"${workspaceFolder}/cpp/Ice/secure",
"${workspaceFolder}/cpp/Ice/session",
"${workspaceFolder}/cpp/Ice/throughput",
],
"cmake.configureSettings": {
"Ice_HOME": "${workspaceFolder}/../ice",
Expand Down
9 changes: 0 additions & 9 deletions cpp/C++ demos.sln
Original file line number Diff line number Diff line change
Expand Up @@ -458,20 +458,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "Ice\greeter\msbui
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "Ice\greeter\msbuild\server\server.vcxproj", "{E4B54261-3921-40D9-AA09-C3C89D096350}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "greeterAsync", "greeterAsync", "{2E31C2CA-8493-4957-9E89-FC9546C2F70B}"
ProjectSection(SolutionItems) = preProject
Ice\greeterAsync\README.md = Ice\greeterAsync\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "secure", "secure", "{DD1B1121-F502-4AB7-8012-633DDC3DD610}"
ProjectSection(SolutionItems) = preProject
Ice\secure\README.md = Ice\secure\README.md
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "Ice\greeterAsync\msbuild\client\client.vcxproj", "{BEB2285A-1D68-4B0B-BFDC-4DC9AFE43A75}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "Ice\greeterAsync\msbuild\server\server.vcxproj", "{9D71F7CB-6F15-41DC-B6D7-69A144513FC3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "Ice\secure\msbuild\client\client.vcxproj", "{651398C4-452B-4E64-8536-4DD9FA88AE1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "Ice\secure\msbuild\server\server.vcxproj", "{A80500EC-13A8-4E5C-AE4D-5168572B9D11}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
cmake_minimum_required(VERSION 3.16)

project(greeter_async CXX)
project(bidir CXX)

include(../../cmake/common.cmake)

add_executable(client Client.cpp Greeter.ice)
add_executable(client Client.cpp Callback.ice)
slice2cpp_generate(client)
target_link_libraries(client Ice::Ice)

add_executable(server Server.cpp Chatbot.cpp Chatbot.h Greeter.ice)
add_executable(server Server.cpp CallbackI.cpp CallbackI.h Callback.ice)
slice2cpp_generate(server)
target_link_libraries(server Ice::Ice)
29 changes: 27 additions & 2 deletions cpp/Ice/bidir/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
# Bidirectional Connections

This demo shows how to use [bidirectional connections][1] for callbacks.
This is typically used if the server cannot open a connection to the
client to send callbacks, for example, because firewalls block
incoming connections to the client.

To build the demo run:

```shell
cmake -B build
cmake --build build --config Release
```

To run the demo, first start the server:

**Linux/macOS:**

```shell
./build/server
```
server

**Windows:**

```shell
build\Release\server
```

In a separate window, start the client:

**Linux/macOS:**

```shell
./build/client
```
client

**Windows:**

```shell
build\Release\client
```

[1]: https://doc.zeroc.com/ice/3.7/client-server-features/connection-management/bidirectional-connections
13 changes: 13 additions & 0 deletions cpp/Ice/callback/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.16)

project(callback CXX)

include(../../cmake/common.cmake)

add_executable(client Client.cpp Callback.ice)
slice2cpp_generate(client)
target_link_libraries(client Ice::Ice)

add_executable(server Server.cpp CallbackSenderI.cpp CallbackSenderI.h Callback.ice)
slice2cpp_generate(server)
target_link_libraries(server Ice::Ice)
31 changes: 29 additions & 2 deletions cpp/Ice/callback/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
# Callback

A simple callback demo that illustrates how a client can pass a proxy
to a server, invoke an operation in the server, and the [server call
back][1] into an object provided by the client as part of that invocation.

To run the demo, first start the server:

To build the demo run:

```shell
cmake -B build
cmake --build build --config Release
```

To run the demo, first start the server:

**Linux/macOS:**

```shell
./build/server
```
server

**Windows:**

```shell
build\Release\server
```

In a separate window, start the client:

**Linux/macOS:**

```shell
./build/client
```
client

**Windows:**

```shell
build\Release\client
```

[1]: https://doc.zeroc.com/ice/3.7/client-server-features/the-ice-threading-model/nested-invocations
13 changes: 13 additions & 0 deletions cpp/Ice/context/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.16)

project(context CXX)

include(../../cmake/common.cmake)

add_executable(client Client.cpp Context.ice)
slice2cpp_generate(client)
target_link_libraries(client Ice::Ice)

add_executable(server Server.cpp ContextI.cpp ContextI.h Context.ice)
slice2cpp_generate(server)
target_link_libraries(server Ice::Ice)
29 changes: 27 additions & 2 deletions cpp/Ice/context/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
# Context

This demo illustrates how to use [request contexts][1].

To build the demo run:

```shell
cmake -B build
cmake --build build --config Release
```

To run the demo, first start the server:

**Linux/macOS:**

```shell
./build/server
```
server

**Windows:**

```shell
build\Release\server
```

In a separate window, start the client:

**Linux/macOS:**

```shell
./build/client
```
client

**Windows:**

```shell
build\Release\client
```

[1]: https://doc.zeroc.com/ice/3.7/client-side-features/request-contexts
4 changes: 4 additions & 0 deletions cpp/Ice/greeter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ target_link_libraries(client Ice::Ice)
add_executable(server Server.cpp Chatbot.cpp Chatbot.h Greeter.ice)
slice2cpp_generate(server)
target_link_libraries(server Ice::Ice)

add_executable(serveramd ServerAMD.cpp ChatbotAMD.cpp ChatbotAMD.h GreeterAMD.ice)
slice2cpp_generate(serveramd)
target_link_libraries(serveramd Ice::Ice)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) ZeroC, Inc.

#include "Chatbot.h"
#include "ChatbotAMD.h"

#include <chrono>
#include <future>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) ZeroC, Inc.

#ifndef CHATBOT_H
#define CHATBOT_H
#ifndef CHATBOT_AMD_H
#define CHATBOT_AMD_H

#include "Greeter.h"
#include "GreeterAMD.h"

namespace GreeterServer
{
Expand Down
Loading
Loading