55 CreateRmiCallee()
The free function CreateRmiCallee<I>() creates a skeleton which is bound to the given MultiplexedMsgConnection such that incoming messages of interface I are forwarded onto the 'receiver' object which implements interface I.
template <typename I>
void CreateRmiCallee(MultiplexedMsgConnection* c, ptr<I> receiver);
In more detail this function performs the following:
- Creates an implementation of IMessageReader that receives incoming messages and forwards then onto 'receiver'. AddReader() is called on the given MultiplexedMsgConnection.
- Creates an implementation of IMessageWriter used to send responses to synchronous messages. AddWriter() is called on the given MultiplexedMsgConnection.
- Ensures that calls to NotifyMoreMessagesToWrite() will be made as required on the given MultiplexedMsgConnection when there are response messages that are ready to be sent because the peer has called Wait() on the RmiCaller
- The RmiCallee 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 CreateRmiCaller() in order to set up their side of the connection.
Assumes the given MultiplexedMsgConnection has been created but OpenConnection() hasn't been called yet.