-
Notifications
You must be signed in to change notification settings - Fork 215
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
New Greeter demo for C# #241
Conversation
@@ -0,0 +1,17 @@ | |||
// Copyright (c) ZeroC, Inc. | |||
|
|||
// Extends Program to provide the CancelKeyPressed property. |
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.
In icerpc-csharp, this file is in a common folder.
internal class Chatbot : GreeterDisp_ | ||
{ | ||
// Implements the abstract method greet from the GreeterDisp_ class generated by the Slice compiler. | ||
public override string greet(string name, Ice.Current current) |
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.
This is a "sync" dispatch, which is the simplest, and certainly ok when the dispatch is indeed sync.
Should I add a GreeterAsync demo that shows AMD, similar to the C++ greeterAsync demo?
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.
I wouldn't.
|
||
// Send a request to the remote object and get the response. | ||
// TODO: remap to GreetAsync with cs:identifier | ||
string greeting = await greeter.greetAsync(Environment.UserName); |
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.
I think we should only demo the client-side async API. The sync API is for backwards compatibility - you probably shouldn't use it in new applications.
You can build the client and server applications with: | ||
|
||
``` shell | ||
dotnet build |
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.
I was building with:
dotnet build /p:IceHome=$HOME/builds/ice /p:IceToolsPath=$HOME/builds/ice/cpp/bin
internal class Chatbot : GreeterDisp_ | ||
{ | ||
// Implements the abstract method greet from the GreeterDisp_ class generated by the Slice compiler. | ||
public override string greet(string name, Ice.Current current) |
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.
I wouldn't.
This new greeter demo is a port of the IceRPC slice/Greeter example. In particular, it uses a similar layout and build system.