TRAP LOCAL

OPTION NETWORK SCTP
OPTION COLLAPSE TRUE
OPTION SOCKET 1

SPLIT ARGUMENT$ BY " " TO arg$ SIZE dim

IF dim < 3 THEN
        PRINT "Usage: ", arg$[0], " <ip> <port>"
        END 1
END IF
ip$ = arg$[1]
port$ = arg$[2]

CATCH GOTO Error
OPEN CONCAT$(ip$,":",port$) FOR NETWORK AS bla

COLOR FG TO GREEN
PRINT "SUCCESS: ";
COLOR RESET
PRINT "the host '", ip$, "' has SCTP at port ", port$, "."

GOTO Continue

LABEL Error
        COLOR FG TO RED
        PRINT "ERROR: ";
        COLOR RESET
        PRINT "the host '", ip$, "' either is not reachable, filtered or has no SCTP at port ", port$, "."

LABEL Continue
        CLOSE NETWORK bla

END