> I wonder if there is a way to set the Non-Blocking mode on sending/receiving
>in RPC without going down to the UNIX socket level, i.e. is there any
>way to set such Non-Blocking mode within a high-level RPC call. I think
>that this is something that RPC library should provide.
> Your help and time is greatly appreciated.
I have to do this for a project here, too. The only way I can think of
is kind of messy:
In the Sun Network Programming manual, it has a section entitled "Select
on the Server Side" - it tells how the _server_ can run asynchonously,
by hand-coding a select() against the rpc-related sockets, then calling
svc_getrequest() when something comes in. The select() can have a timeoout
associated with it, and that's where you get your asynchronicity.
This doesn't go quite all the way down to sockets, but it go down
further than would be hoped.
If you want the _client_ to run asynchronously, then you can use what
Sun calls "Batching" - The client sends a request to the server, but
the server-side rpc is written so that it returns an ACK immediatly,
then does the processing. The client recieves the ACK, then does
whatever it wants for a while. Later, the client sets himself up as
an rpc-server, and the server process calls the client with the
results of his work. Also messy, but explained in most rpc network
But I don't really like these techniques, because I find them pretty
confusing, and writting code this way gets involved in too many low-
level things - And the point of rpc's is to avoid all this complexity.
Does anyone know of a simpler way so use rpc's asynchronously?
-- Stuart Marquis -- It's simple. If I said it, --
"Their eyes meet and her heart starts flopping around weakly, like a bunny
in a Ziploc bag. He grins and waves." - Stephenson, Snow Crash