Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
osexpert authored Sep 4, 2024
1 parent 892c99d commit b8eecab
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
# GoreRemoting

public interface IService
public interface IService
{
Task<string> EchoAsync(string s);
}
public class Service : IService
{
public async Task<string> EchoAsync(string s)
{
Task<string> EchoAsync(string s);
await Task.Delay(10);
return s;
}
public class Service : IService
}
public Task Server()
{
var remServer = new RemotingServer(new ServerConfig(new BinaryFormatterAdapter());
remServer.RegisterService<IService, Service>();

var server = new Grpc.Core.Server()
{
public async Task<string> EchoAsync(string s)
Services =
{
await Task.Delay(10);
return s;
ServerServiceDefinition.CreateBuilder()
.AddMethod(remServer.DuplexCallDescriptor, remServer.DuplexCall)
.Build()
}
}
public Task Server()
{
var remServer = new RemotingServer(new ServerConfig(new BinaryFormatterAdapter());
remServer.RegisterService<IService, Service>();

var server = new Grpc.Core.Server()
{
Services =
{
ServerServiceDefinition.CreateBuilder()
.AddMethod(remServer.DuplexCallDescriptor, remServer.DuplexCall)
.Build()
}
};
server.Ports.Add("0.0.0.0", 5000, ServerCredentials.Insecure);
server.Start();
// wait for shutdown
return server.ShutdownTask;
}
public async Task Client()
{
var channel = new Channel("localhost", 5000, ChannelCredentials.Insecure);
var client = new RemotingClient(channel.CreateCallInvoker(), new ClientConfig(new BinaryFormatterAdapter()));
var proxy = client.CreateProxy<IService>();
};
server.Ports.Add("0.0.0.0", 5000, ServerCredentials.Insecure);
server.Start();
// wait for shutdown
return server.ShutdownTask;
}
public async Task Client()
{
var channel = new Channel("localhost", 5000, ChannelCredentials.Insecure);
var client = new RemotingClient(channel.CreateCallInvoker(), new ClientConfig(new BinaryFormatterAdapter()));
var proxy = client.CreateProxy<IService>();

var echo = await proxy.EchoAsync("Hello world!");
}
var echo = await proxy.EchoAsync("Hello world!");
}

GoreRemoting is based on CoreRemoting
https://github.com/theRainbird/CoreRemoting
Expand Down

0 comments on commit b8eecab

Please sign in to comment.