*DECK IPPOPES
USETEXT TEXTIPL
PROC IPPOPES (SOCKID, SOCKTYPE, SOCKSTATUS);
*CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992.
# TITLE IPPOPES - OPEN SOCKET #
BEGIN # IPPOPES #
#
**** IPPOPES OPEN SOCKET
*
* THIS PROCEDURE OPENS A SOCKET TO THE TCP/IP GATEWAY.
*
* PROC IPPOPES
*
* ENTRY SOCKTYPE = 0 - UDP, 1 - TCP.
*
* EXIT SOCKID = INTEGER VALUE OF SOCKET
* SOCKSTATUS = COMPLETION STATUS
*
* METHOD IF THIS IS A *UDP* SOCKET THEN A SINGLE *NAM* CONNECTION
* IS CREATED. IF THIS IS A *TCP* SOCKET, THEN TWO *NAM*
* CONNECTIONS ARE CREATED, A CONTROL AND A DATA CONNECTION.
* CURRENTLY ONLY *UDP* WILL BE SUPPORTED.
*
#
#
**** PROC IPPOPES - XREF LIST
#
XREF
BEGIN
PROC IPIDOSM; # DISPATCH OUTPUT SUPERVISORY MESSAGE #
PROC IPINITH; # NAM INPUT TRAFFIC HANDLER #
END
#
**
#
ITEM LOOP I; # LOOP COUNTER #
ITEM SOCKTYPE S:PTYPE; # SOCKET TYPE #
ITEM SOCKID I; # SOCKET IDENTIFIER #
ITEM SOCKSTATUS S:SOCKSTAT; # RETURNED SOCKET STATUS #
CONTROL EJECT;
#
**** START MAIN PROCEDURE
#
SWITCH SOCK$:PTYPE SOCK$UDP:SOCKETUDP,
SOCK$TCP:SOCKETTCP;
GOTO SOCK$ [SOCKTYPE];
BEGIN # SOCKET TYPE #
SOCK$UDP:
P<ABH> = LOC (SABH); # BASE ABH POINTER #
ABHABN [0] = CONNECTABN$; # DEFINE BLOCK NUMBER FOR ACRQ #
P<APSM> = LOC (OUTBUF); # BASE SUPERVISORY MESSAGE PTR #
SPMSG0 [0] = 0;
SPMSG1 [0] = 0;
CONANM [0] = TGW$BASENAME [0]; # TCP/IP GATEWAY NAME #
CONANM2 [0] = TGW$MID [0];
IPIDOSM (CONACR, LCONAC); # SEND CON/ACRQ SM #
ABHABN [0] = 0; # CLEAR APPLICATION BLOCK NUMBER#
ISS$WORD [0] = 0; # CLEAR CONNECTION STATUS WORD #
ISS$STATUS [0] = SOCKSTAT"WAIT";
BLOCK = TRUE; # DEFAULT NETWAIT TIMER 2 SEC #
FOR LOOP = 0
WHILE (ISS$STATUS EQ SOCKSTAT"WAIT") DO
BEGIN
IPINITH; # NAM INPUT TRAFFIC HANDLER #
END
GOTO OPEN$END;
SOCK$TCP:
END # SOCKET TYPE #
OPEN$END:
SOCKSTATUS = ISS$STATUS [0];
SOCKID = ISS$ACN [0];
RETURN; # RETURN TO CALLER #
END # IPPOPES #
TERM