jcd@sunkist.west.sun.com (Jean-Claude Dulac) (05/10/91)
I have a problem understanding the RpcPeer class and in implemented
the virtual functions createReaderAndWriter. The documentation specifies
that you would typically create a writer and then attach a reader to the
writer's rpcstream. I go ahead with the following code:
boolean Service::createReaderAndWriter(cosnt char *rHost,int rPort) {
writer = new Writer(rHost,rPort);
new Reader(&(writer-> server()), this) ;
}
But when the Writer constructer is called I get the following message:
rpcbuf::underflow: read: Operation would block
and later I get a segmentation fault in rpcbuf::error called from
rpcbuf::read_request.
First question: What am I doing wrong?
The second question is: The RpcPeer on the other side of the connection
(the first to be created) never calls createReaderAndWriter.
It starts listening and run for ever. Why createReaderAndWriter never
get called?
Any help would be greatly appreciated.
Thanks.
-Jean-Claude Dulac