52 CreateRmiCaller()

The free function CreateRmiCaller<I>() creates an RmiCaller for rmi interface I which allows for sending messages over the given MultiplexedMsgConnection.


template <typename I>
RmiCaller* CreateRmiCaller(MultiplexedMsgConnection* c);

In more detail it performs the following:

  • Creates an implementation of IMessageWriter that sends remote invocation calls. AddWriter() is called on the given MultiplexedMsgConnection.
  • Creates an implementation of IMessageReader that receives responses for synchronous method calls. AddReader() is called on the given MultiplexedMsgConnection.
  • Ensures that calls to NotifyMoreMessagesToWrite() will be made as required on the given MultiplexedMsgConnection when there are buffered messages that are ready to be sent.
  • The RmiCaller is automatically deleted after both IMessageWriter::ReleaseWriter() and IMessageReader::ReleaseReader() calls have been made

The created IMessageWriter/IMessageReader are concerned with supporting remote method calls on the interface.

It is expected that the peer will call CreateRmiCallee() in order to set up their side of the connection.

Assumes the given MultiplexedMsgConnection has been created but OpenConnection() hasn't been called yet.