Operating System - OpenVMS
1753929 Members
9261 Online
108810 Solutions
New Discussion

Hand off a connected socket connection to another process

 
Brian Reiter
Valued Contributor

Hand off a connected socket connection to another process

Hi Folks,

 

How easy would it be to write a program which would accept an inbound TCP/IP connection and hand that connection off to another process to deal with?

 

I know I could create a TCPIP service to do thi but some system restrictions mean it may be required to do this ourselves. 

 

 

Regards

 

Brian Reiter 

4 REPLIES 4
Ruslan R. Laishev
Super Advisor

Re: Hand off a connected socket connection to another process

Hi !

 

 Take a look to the sys$examples:

 

http://starlet.spb.ru/sys$examples/TCPIP/*.*

Hoff
Honored Contributor

Re: Hand off a connected socket connection to another process

Have a look at Apache or WASD, for how those deal with server process pools.

 

I and others have asked for that hand-off API but — AFAIK — there is no supported means for performing that hand-off. (While there are undocumented means — no, I don't have a link for those, and haven't seen any undocumentation — I'm not inclined to use those in general, and particularly not now given that VSI is reportedly replacing the IP stack with something else in an upcoming OpenVMS release.)

 

Things here get more interesting when handing off an encrypted connection, too — that's not something I've encountered on OpenVMS.

 

On OpenVMS, using inetd is the usual approach, starting up the receiver as necessary. 

 

Something like http://gearman.org would be handy, but I've not seen that ported to OpenVMS.

Brian Reiter
Valued Contributor

Re: Hand off a connected socket connection to another process

The solution was relatively easy.  

 

Set the listen socket to shareable and then when the client connects grab the unit number (LIB$GETDVI) and pass that to the newly created client process.  The client process can then generated the appropriate device name (BG<unit>) and assign to that.

 

 

 

Hoff
Honored Contributor

Re: Hand off a connected socket connection to another process


@Brian Reiter wrote:

The solution was relatively easy.  

 

Set the listen socket to shareable and then when the client connects grab the unit number (LIB$GETDVI) and pass that to the newly created client process.  The client process can then generated the appropriate device name (BG<unit>) and assign to that.

 

 

 


 

FWIW, if that's all you're doing, use inetd (OpenVMS calls it the "auxillary server"), as that's what inetd provides...