Created
September 8, 2017 05:38
-
-
Save matiasinsaurralde/e3f947a5c5e702ceb66d8f993e0a7832 to your computer and use it in GitHub Desktop.
Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Grpc.Core; | |
namespace tyk_plugin | |
{ | |
class Program | |
{ | |
// Port to attach the gRPC server to: | |
const int Port = 5555; | |
static void Main(string[] args) | |
{ | |
// We initialize a Grpc.Core.Server and attach our dispatcher implementation to it: | |
Server server = new Server | |
{ | |
Services = { Coprocess.Dispatcher.BindService(new DispatcherImpl()) }, | |
Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } | |
}; | |
server.Start(); | |
Console.WriteLine("gRPC server listening on " + Port); | |
Console.WriteLine("Press any key to stop the server..."); | |
Console.ReadKey(); | |
server.ShutdownAsync().Wait(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment