Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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: 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
13 changes: 13 additions & 0 deletions cpp/Ice/bidir/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.16)

project(bidir 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 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: 2 additions & 2 deletions cpp/Ice/greeter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To run the demo, first start the server:
**Windows:**

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

In a separate window, start the client:
Expand All @@ -34,5 +34,5 @@ In a separate window, start the client:
**Windows:**

```shell
.\build\Release\client
build\Release\client
```
2 changes: 1 addition & 1 deletion cpp/Ice/greeterAsync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To run the demo, first start the server:
**Windows:**

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

In a separate window, start the client:
Expand Down
3 changes: 2 additions & 1 deletion cpp/Ice/interceptor/AuthenticatorI.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) ZeroC, Inc.

#include <AuthenticatorI.h>
#include "AuthenticatorI.h"

#include <Ice/Ice.h>
#include <iostream>

Expand Down
19 changes: 19 additions & 0 deletions cpp/Ice/interceptor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.16)

project(interceptor CXX)

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

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

add_executable(server
Server.cpp
InterceptorI.cpp InterceptorI.h Interceptor.ice
ThermostatI.cpp ThermostatI.h
AuthenticatorI.cpp AuthenticatorI.h
)

slice2cpp_generate(server)
target_link_libraries(server Ice::Ice)
3 changes: 2 additions & 1 deletion cpp/Ice/interceptor/InterceptorI.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#ifndef INTERCEPTOR_I_H
#define INTERCEPTOR_I_H

#include <AuthenticatorI.h>
#include "AuthenticatorI.h"

#include <Ice/Ice.h>
#include <unordered_set>

Expand Down
29 changes: 27 additions & 2 deletions cpp/Ice/interceptor/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
# Interceptor

This demo shows how to use [Dispatch Interceptors][1] to implement a token based
authentication system for securing operations on a remote object.

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
```

The demo models a remote controlled thermostat with operations for getting and setting
Expand Down
3 changes: 2 additions & 1 deletion cpp/Ice/interceptor/ThermostatI.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#ifndef THERMOSTAT_I_H
#define THERMOSTAT_I_H

#include <Interceptor.h>
#include "Interceptor.h"

#include <mutex>

class ThermostatI : public Demo::Thermostat
Expand Down
13 changes: 13 additions & 0 deletions cpp/Ice/interleaved/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.16)

project(interleaved CXX)

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

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

add_executable(server Server.cpp ThroughputI.cpp ThroughputI.h Throughput.ice)
slice2cpp_generate(server)
target_link_libraries(server Ice::Ice)
27 changes: 25 additions & 2 deletions cpp/Ice/interleaved/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,39 @@ The interleaved demo is a variant of the throughput demo that uses asynchronous
requests to send "echo" requests to the server. This way, the client sends
multiple concurrent requests and we maximize the bandwidth usage.

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
```

See the throughput demo for a description of the metadata used in
Expand Down
13 changes: 13 additions & 0 deletions cpp/Ice/invoke/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.16)

project(greeter CXX)

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

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

add_executable(server Server.cpp PrinterI.cpp PrinterI.h Printer.ice)
slice2cpp_generate(server)
target_link_libraries(server Ice::Ice)
Loading
Loading