Giter Club home page Giter Club logo

csharptest.net.rpclibrary's Introduction

CSharpTest.Net.RpcLibrary

CSharpTest.Net.RpcLibrary (moved from https://code.google.com/p/csharptest-net/)

Change Log

2014-03-26 Initial clone and extraction from existing library.

Online Help

Sample Client: /src/ExampleClient/Program.cs

Client Help: http://help.csharptest.net/?CSharpTest.Net.RpcLibrary~CSharpTest.Net.RpcLibrary.RpcClientApi.html

Sample Server: /src/ExampleServer/Program.cs

Server Help: http://help.csharptest.net/?CSharpTest.Net.RpcLibrary~CSharpTest.Net.RpcLibrary.RpcServerApi.html

Quick start

Example server application

var iid = new Guid("{1B617C4B-BF68-4B8C-AE2B-A77E6A3ECEC5}");
using (var server = new RpcServerApi(iid, 100, ushort.MaxValue, allowAnonTcp: false))
{
    // Add an endpoint so the client can connect, this is local-host only:
    server.AddProtocol(RpcProtseq.ncalrpc, "RpcExampleClientServer", 100);
    // Add the types of authentication we will accept
    server.AddAuthentication(RpcAuthentication.RPC_C_AUTHN_GSS_NEGOTIATE
    // Subscribe the code to handle requests on this event:
    server.OnExecute +=
        delegate(IRpcClientInfo client, byte[] bytes)
            { return new byte[0]; };
    // Start Listening 
    server.StartListening();
	// Wait...
	Console.ReadLine();
}

Example client application

var iid = new Guid("{1B617C4B-BF68-4B8C-AE2B-A77E6A3ECEC5}");
using (var client = new RpcClientApi(iid, RpcProtseq.ncalrpc, null, "RpcExampleClientServer"))
    //using (var client = new RpcClientApi(iid, RpcProtseq.ncacn_ip_tcp, null, @"18081"))
{
    // Provide authentication information (not nessessary for LRPC)
    client.AuthenticateAs(RpcClientApi.Self);
    // Send the request and get a response
    byte[] response = client.Execute(new byte[0]);
}

Interface Identifiers in RPC

Every Win32 RPC server is identified by an Interface GUID (IID). A process may have only one instance listening on any give IID at a time.

Unlike WCF and other connection-oriented channels, RPC keeps the connection apart from the objects avaialable. This means that a single object instance can listen on multiple endpoints, including multiple different protocols. It's important to understand that the IID is the 'object selector' in RPC not the endpoint you are listening on.

csharptest.net.rpclibrary's People

Contributors

0xfeeddeadbeef avatar csharptest avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.