svc_getreqset() (RPC) problem

svc_getreqset() (RPC) problem

Post by Curt Mil » Fri, 03 Oct 1997 04:00:00



Has anyone had problems on Solaris 2.5 using
select() and svc_getreqset() in RPC server code?

I can call svc_run() just fine and have my service
routine get called, but if I instead try to do
my own select() (after snagging the value of svc_fdset
into my own fdset), I always get an EBADF error
(it's telling me that one or more of my file
descriptors are bad).

I have also tried just setting the bit for the
file descriptor I'm interested in, and it then
DOES call svc_getreqset(), but svc_getreqset()
returns immediately without calling the service
routine.  Truss says that it is failing while
trying to DUP a file descriptor.

Are there any known problems with RPC on Solaris 2.5?
I am porting code that works fine under SunOS 4.1.3,
and have an example to go on that someone else had
working under Solaris and SunOS, but maybe he was
running some patches that I'm not?

I need to do my own select() loop in order to do some
additional processing in the RPC server, otherwise
I'd be more than happy just using svc_run().

Thanks for any help,

--

Senior Methods Engineer/SysAdmin
"Lotto:    A tax on people who are bad at math." -- unknown
"Windows:  Microsoft's tax on computer illiterates." -- WE7U

 
 
 

svc_getreqset() (RPC) problem

Post by Roger McCalm » Fri, 10 Oct 1997 04:00:00



>Has anyone had problems on Solaris 2.5 using
>select() and svc_getreqset() in RPC server code?

I had alot of problems with RPC on Solaris. It is based
on 'tli' and therefore all the sockets must have been created
by the TLI calls.

There is a couple of calls for getting hold of the fd's that
need to be polled I can't remeber the details it is something
like _svc_getpollset() - it is designed for use with poll
rather than select but I suppose you could to the translation.

Cheers, Roger

 
 
 

svc_getreqset() (RPC) problem

Post by Boris Goldber » Thu, 16 Oct 1997 04:00:00




> >Has anyone had problems on Solaris 2.5 using
> >select() and svc_getreqset() in RPC server code?

> I had alot of problems with RPC on Solaris. It is based
> on 'tli' and therefore all the sockets must have been created
> by the TLI calls.

> There is a couple of calls for getting hold of the fd's that
> need to be polled I can't remeber the details it is something
> like _svc_getpollset() - it is designed for use with poll
> rather than select but I suppose you could to the translation.

> Cheers, Roger

They work fine in my code, though I must admit that TI-RPC is
a *'s dream.
 
 
 

1. RPC Guru: tcp, svc_fdset changing across svc_getreqset()

I need to know if there is a "right" (portable across various
unix's) answer to this question:

  How many file descriptors (in svc_fdset) can change across a
  call to svc_getreqset()?  

As you may have guessed, this has to do with integrating a
tcp based rpc server into the event loop of a motif (Xt)
application.  Our code is based on an example from the
`Roo book (ORA/Bloomer's power programming with RPC).

When I originally coded our implementation (for solaris 2.6),
I assumed that only a single fds could change across the
svc_getreqset() call... that is, only one new tcp socket could have
appeared, OR one old tcp socket could have disappeared.

When using our code under irix 6.5.4 with a rpc server that
has some "one way" procedures (return void), I found (much
to my dismay) that two closely placed (in time) calls to
the same "one way" procedure on the same rpc server can
cause TWO fds's two change across the call to svc_getreqset().
In the cases I have discovered, the change is that one
old file descriptor has been removed AND one new file
descriptor has been added (fdset.fds_bits[0] changing
from 0x58 to 0x98) across the call to svc_getreqset().)

So my "single fds change" assumption was incorrect at
least in part, and at least for irix .... so i need to
change my code to deal with the cases of a) one added, b) one
removed, and c) one added and one removed....

Which brings me to the point where I need an answer
to the question I ask above.... Q1) can more than one fds
be added across the svc_getreqset() call; Q2) can more than
one fds be removed across the svc_getreqset() call?

The answer needs to be portable across at least solaris,
irix, and linux.

thanks, guys.

-al

2. One LAN Two Samba servers?

3. How to use rpc.portmap, rpc.mountd, rpc.nfsd?

4. Moving from Solaris/CDE to Solaris/GNOME?

5. Where are rpc.portmap, rpc.mountd, rpc.nfsd?

6. FreeBSD CDs fail on high-speed CD-ROM drive?

7. Dangers of rpc.portmap, rpc.mountd, rpc.nfsd

8. Specify libstdc++ version

9. RPC 4.0 vs RPC 4.1 vs TI RPC

10. Comparison bet soap rpc, dce rpc and sun rpc

11. RFI: RPC books; Also Problem with Sun Solaris 2.4 and RPC

12. Debugging svc_getreqset

13. svc_getreqset() never returns with ypserv-1.3.7 under Solaris 2.5.1