[Info-vax] Apache + mod_php performance
Arne Vajhøj
arne at vajhoej.dk
Mon Oct 7 13:49:23 EDT 2024
On 10/7/2024 12:47 PM, Mark Berryman wrote:
> It is most definitely possible as that is precisely what the auxiliary
> server in TCPIP Services does. It listens for a connection, then
> creates a process to handle it. See the description of TCPIP$C_AUXS in
> the TCPIP Services programming documentation.
SYS$COMMON:[SYSHLP.EXAMPLES.TCPIP]TCPIP$TCP_SERVER_SOCK_AUXS.C has:
/*
* create socket
*/
if ( (sockfd = socket(TCPIP$C_AUXS, SOCK_STREAM, 0)) < 0 )
{
perror( "Failed to create socket" );
exit( EXIT_FAILURE );
}
but the equivalent
SYS$COMMON:[SYSHLP.EXAMPLES.TCPIP]TCPIP$TCP_SERVER_QIO_AUXS.C
gives some hints about what it is doing:
struct sockchar conn_sockchar; /* connect socket char buffer */
...
$DESCRIPTOR( inet_device, /* string descriptor with logical */
"SYS$NET:" ); /* name of internet pseudodevice */
...
/*
* init connection socket characteristics buffer
*/
conn_sockchar.prot = TCPIP$C_TCP;
conn_sockchar.type = TCPIP$C_STREAM;
conn_sockchar.af = TCPIP$C_AUXS;
...
/*
* assign device socket
*/
status = sys$assign( &inet_device, /* device name */
&conn_channel, /* i/o channel */
0, /* access mode */
0 /* not used */
);
if ( !(status & STS$M_SUCCESS) )
{
printf( "Failed to assign i/o channel to TCPIP device\n" );
exit( status );
}
...
/*
* create connection socket
*/
status = sys$qiow( EFN$C_ENF, /* event flag
*/
conn_channel, /* i/o channel
*/
IO$_SETMODE, /* i/o function code
*/
&iosb, /* i/o status block
*/
0, /* ast service routine
*/
0, /* ast parameter
*/
&conn_sockchar, /* p1 - socket char buffer
*/
0, /* p2
*/
0, /* p3
*/
0, /* p4
*/
0, /* p5
*/
0 /* p6
*/
);
if ( status & STS$M_SUCCESS )
status = iosb.status;
if ( !(status & STS$M_SUCCESS) )
{
printf( "Failed to create socket\n" );
exit( status );
}
But it is not clear (at least not to me) whether:
- the original TCP/IP device was made shareable and SYS$NET just points
to it
or:
- the original TCP/IP device is connected to a new pseudodevice that
SYS$NET points to
The first seems by far the simplest, but the comment indicate
the second.
Arne
More information about the Info-vax
mailing list