RPCServer

Implementation of a JSON-RPC server.

This implementation only supports communication via TCP sockets.

More...
class RPCServer (
API
Listener = TCPListener!API
) if (
is(API == class) &&
isListener!(Listener!API)
) {}

Constructors

this
this(string host, ushort port)

Construct an RPCServer!API object to communicate via TCP sockets.

this
this(API api, string host, ushort port)

Construct an RPCServer!API object to communicate via TCP sockets.

Members

Functions

listen
void listen(int maxQueuedConnections)

Listen for and respond to connections.

Detailed Description

Template Parameters

API = A class or struct containing the functions available for the client to call. <BR> Listener = The object to use to manage client connections. By default, a TCPTransport.

Examples

class MyFunctions {
    long func(string param) { return 56789; }
}

// Bind to a local port and serve func on a platter.
auto serve = new RPCServer!MyFunctions("127.0.0.1", 54321);
serve.listen();

Meta