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 = 10)

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

1 class MyFunctions {
2     long func(string param) { return 56789; }
3 }
4 
5 // Bind to a local port and serve func on a platter.
6 auto serve = new RPCServer!MyFunctions("127.0.0.1", 54321);
7 serve.listen();

Meta