Open file (or socket) descriptor passing from one process to another
Posted in 2006
Topics: Networking & sqlhosts Configuration
Hi, everybody, Some time ago we had a discussion about the possibility to pass the descriptor of an open file (or descriptor of an open network socket) from one UNIX process to another. I incidentally found the answer to that question. UNIX SVR4 has the following method to do that: descriptor can be passed over a streams pipe, using ioctl call with I_SENDFD command. The other process receives it through the I_RECVFD ioctl call. Looks like, Informix engine is using this approach for network connections: connection or query request is received by the POLL thread running usually on NETVP, whine CPUVP is sending the response to the client directly, by executing sendto() on the same open network socket. ------------------------------------------ Alexey Sonkin
Alexey Sonkin wrote: > Hi, everybody, > > Some time ago we had a discussion about the possibility > to pass the descriptor of an open file (or descriptor of > an open network socket) from one UNIX process to another. Alexey, I don't remember the discussion. Only one about being able to share a DB cursor between processes and that's a different animal. Art S. Kagel > I incidentally found the answer to that question. > UNIX SVR4 has the following method to do that: descriptor > can be passed over a streams pipe, using ioctl call with > I_SENDFD command. The other process receives it through > the I_RECVFD ioctl call. > > Looks like, Informix engine is using this approach for > network connections: connection or query request is > received by the POLL thread running usually > on NETVP, whine CPUVP is sending the response to the client > directly, by executing sendto() on the same open network socket. > > ------------------------------------------ > Alexey Sonkin > >
Alexey Sonkin wrote: > Hi, everybody, > > Some time ago we had a discussion about the possibility > to pass the descriptor of an open file (or descriptor of > an open network socket) from one UNIX process to another. Alexey, I don't remember the discussion. Only one about being able to share a DB cursor between processes and that's a different animal. Art S. Kagel > I incidentally found the answer to that question. > UNIX SVR4 has the following method to do that: descriptor > can be passed over a streams pipe, using ioctl call with > I_SENDFD command. The other process receives it through > the I_RECVFD ioctl call. > > Looks like, Informix engine is using this approach for > network connections: connection or query request is > received by the POLL thread running usually > on NETVP, whine CPUVP is sending the response to the client > directly, by executing sendto() on the same open network socket. > > ------------------------------------------ > Alexey Sonkin > >