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

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

My message parsing function for the connection object starts like
this:

        FileInputStream raw_input(fd);      //fd is the socket file
descriptor
        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 proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to