identification division.
program-id. ipv6.
* Autor Stockebrand in IX 06-2007
* Netzansatz, p138ff
author. "JD".
date-written. 27.8.2006.
date-compiled.
data division.
working-storage section.
77 sockd pic 9(8) comp.
77 statusd pic 9(8) comp.
77 exit-failure pic 9(8) comp value -802.
77 socket2 pic X(88) value "socket(2)".
linkage section.
01 i.
05 ai-next pic 9(8) comp.
05 ai-family pic 9(8) comp.
05 ai-socktype pic 9(8) comp.
05 ai-protocol pic 9(8) comp.
05 ai-addr pic 9(8) comp.
05 ai-addrlen pic 9(8) comp.
77 results pic 9(8) comp.
77 retval pic 9(8) comp.
procedure division using results returning retval.
move 0 to retval
move results to i
perform until i <= 0
call socket using sockd
ai-family
ai-socktype
ai-protocol
if sockd<0 then
call perror using socket2
move exit-failure to retval
stop run
end-if
call connect using statusd
sockd
ai-addr
ai-addrlen
ai-protocol
if statusd > 0 then
call closer using sockd
else
goto break
end-if
end-perform
break.
if i=0 then
display "Could not establish connection"
move exit-failure to retval
stop run
end-if
display "connection successfully opened".
end-program ipv6.
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
|
Haftungshinweis
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.
|