' TCP Chat — Simple TCP messaging demo (standalone reference)
' NOTE: This is a reference implementation. No actual connection is attempted.
' TCP functions require runtime network support (bestof_tcp_*).
#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    LOCAL hClient AS LONG
    LOCAL msg AS STRING

    PRINT "TCP Chat Demo"
    PRINT STRING$(30, 45)
    PRINT
    PRINT "Reference sequence for TCP messaging:"
    PRINT
    PRINT "  Server: Steps 1-6"
    PRINT "    1. TCP OPEN 8080"
    PRINT "    2. TCP LISTEN port, 5"
    PRINT "    3. TCP ACCEPT handle"
    PRINT "    4. TCP RECV handle, 1024"
    PRINT "    5. TCP SEND handle, data"
    PRINT "    6. TCP CLOSE handle"
    PRINT
    PRINT "  Client: Steps 1-5"
    PRINT "    1. TCP OPEN 0"
    PRINT "    2. TCP CONNECT handle, host, port"
    PRINT "    3. TCP SEND handle, message"
    PRINT "    4. TCP RECV handle, 1024"
    PRINT "    5. TCP CLOSE handle"
    PRINT
    PRINT "See 19_TCP_UDP/ for full TCP samples"

    FUNCTION = 0
END FUNCTION
