I've developed a C++ RPC server using protobufs as the IDL. It works
great. Thanks for protobufs!

When a client connects to the RPC server, a seperate thread in the
server handles the connection and blocks, waiting for data from the

My message parsing function for the connection object starts like

        FileInputStream raw_input(fd);      //fd is the socket file
        CodedInputStream input(&raw_input);

        uint32 tag = input.ReadTag();

This is all fine and dandy except when I want to shutdown the server
or connection (not client initiated). The ReadTag (as well as the
other Read functions) blocks until data is received but I want it to
timeout after a specified amount of time. So in essence a polling read
instead of a blocking one. This will allow me to check that the
connection is still valid and either re-enter my message parsing
function or cleanup and exit.

Any ideas on how I can accomplish this?

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to