I have successfully created a resource manager that overloads the default functionality for io_read, io_write, and io_devctl.
The system that I am creating my resource managers for needs to be able to send some sort of message to a server (this could be an “empty” message or with some data). The receiver of this message (a resource manager/server) will do some sort of processing and then need to send an abitrarily long result string (char*) back to the process that sent the original message. I am able to use a devctl message to send the data to the server, but I haven’t been able to figure out how to send the result string back. I can do it by preallocating a large buffer that is sent in the original devctl message to be modified by the server, but I don’t like that as it is a kludge.
What I would like to do (assuming devctl’s won’t work in this situation) is have the client use MsgSend() to send a msg with or without data to the server. Then have the server respond with a MsgReply(). Given the prototypes for MsgSend() and MsgReply() they easily support the concept of replying with an arbitrarily sized amount of data to the sender. My dilema with this approach is that I would like to still use Resource managers for other reasons, but I can’t figure out, or find an examples of how to recieve my messages and reply to them in the resource manager code. I understand that internally the resource manager library uses a MsgReceive to deal with all incoming msgs, but I don’t know how to get my msgs to the code I have written so that I can respond in the manner I need to. I would like to do this without breaking any of the standard POSIX functionality resource managers give you ( read(), write(), open(), etc, etc).
Hopefully I have been clear enough. Any and all help would be appriciated.
Note I have read through the pertinent sections of the nto_prog.pdf and “Getting Started with Neotrino 2” but have come up empty in this regard.