I would appreciate some feedback and ideas from SuperBASIC programmers. I'm continuing work on my W5300 based ethernet card driver for a black box QL. The driver currently supports TCP_ channels and SuperBASIC OPEN, CLOSE, PRINT, INKEY$ and INPUT keywords. Syntax of the driver string is currently "TCP_<host>:<port>". This is enough for most TCP client software, and in fact Tim and Dilwyn's SuperBASIC IRC client runs nicely already (also when QLiberated). I'm currently in the process of adding UDP support so that e.g. NTP client is easy to write in SuperBASIC.
Next thing on my to-implement list is socket listen functionality. This will enable QL-to-QL communications, or some simple server software (e.g. HTTP shoutbox) to be implemented easily.
I would appreciate some insight on what would be a semantically coherent approach to defining a listening TCP socket from SuperBASIC. For listening, the remote host is obviously not required, but the port on which the socket should listen must be specified. Some approaches I have considered so far:
Code: Select all
OPEN #chan,"TCP_:<listen-port>"
The missing host part would imply a listening socket
Code: Select all
OPEN #channel,"TCP_":SOCK_LISTEN (#channel,port)
Code: Select all
OPEN "TCPL_<port>"
I would really appreciate if you could take a minute to consider what would be the most "SuperBASIC-y" way of doing this. Feedback and opinions on changes / new approaches is welcome.
Kind regards,
Petri