1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Networking has been added to Brandy BASIC as of version 1.21.6, significant
bugs fixed for 1.21.7, and IPv6 capability added for 1.21.8.
The interface is as such:
Open a file handle using OPENUP, instead of a filename use "ip0:host:port",
"ip4:host:port" or "ip6:host:port". When using "ip0" it'll use whichever
is available, ip4 and ip6 request the connection to use only that protocol.
PRINT# and INPUT# are NOT implemented for this, for a BBC BASIC internal
format these are rather pointless for communicating with anything else.
BGET# returns the next byte in the buffer, or -1 if no data waiting.
(This is NOT an error condition, an interactive service like Telstar will
not send data when it doesn't need to.) If the remote host has closed the
connection, it will return -2 once the receive buffer is exhausted.
GET$# returns a line of text up to the next newline.
BPUT# allows bytes or strings to be sent.
CLOSE# closes the network channel. This should be done even if the remote
host has closed the connection.
|