' ============================================
' Spectranet TCP Client Demo (Boriel BASIC)
' ============================================
' Open a TCP connection to 192.168.1.50 port 5000
OPEN #4, "TCP:192.168.1.50:5000"
' Send a message
PRINT #4, "HELLO FROM ZX SPECTRUM"
' Prepare buffer
DIM buffer(255) AS UBYTE
DIM n AS UINTEGER
DIM i AS UINTEGER
' Read up to 255 bytes
n = INPUT$(#4, @buffer(0), 255)
' Print received bytes
i = 0
DO WHILE i < n
PRINT CHR$(buffer(i));
i = i 1
LOOP
' Close socket
CLOSE #4
PRINT
PRINT "DONE"
My game has now progressed!!!
Finally it no longer crashes, memory usage had been reduced about 40%! I can now focus on events, story and graphics.
See you next year 😂