Exemple #1
0
        public RpcError testCancel()
        {
            RpcError result = RpcApi.RpcServerTestCancel(RpcServerApi2.RpcAsyncGetCallHandle(asyncState));

            return(result);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            var iid = new Guid("{04f5e707-d969-4822-95c5-2f3d4fd47f77}");

              using (var server = new RpcServerApi2(iid, 100, ushort.MaxValue, allowAnonTcp: false))
              {
            try
            {
              server.AddProtocol(RpcProtseq.ncalrpc, "3242", 100);

              server.AddAuthentication(RpcAuthentication.RPC_C_AUTHN_GSS_NEGOTIATE);
              server.AddAuthentication(RpcAuthentication.RPC_C_AUTHN_WINNT);
              server.AddAuthentication(RpcAuthentication.RPC_C_AUTHN_NONE);

              server.OnExecute += execute;
              server.OnExecuteAsync += executeAsync2;

              server.StartListening();
            }
            catch (Exception ex)
            {
              Console.Error.WriteLine(ex);
              throw;
            }

            // Wait until you are done...
            Console.WriteLine("Press [Enter] to exit...");
            Console.ReadLine();

            fireShutDownEvent();
              }
        }