I started writing this because the default SOCKET interface doesn't support UDP, etc.
Also, the old ssocket module has some weird stuff going on in it.
Not finished yet, but here is an example:
import sock.bas
' CREATE NEW **UDP** CONNECTION
conn = SOCK::NEW(SOCK::AF_INET, SOCK::SOCK_DGRAM, SOCK::IPPROTO_IP)
' SET THE SOCKET CONNECTION PARAMETERS
' SERVER, CONNECTION TYPE, PORT
' FOR RETRIEVING LOCAL IP NON-EXISTANT SERVER IS OKAY
SOCK::SET("1.0.0.0",SOCK::AF_INET,1)
' CONNECT
SOCK::CONNECT(conn)
' RETRIEVE IP OF **DEFAULT** ADAPTER
' DOESN'T MATTER IF IT IS ETHERNET OR WIFI
' THE IP OF THE DEFAULT ADAPTER IS RETURNED
print "Active IP: ",SOCK::GETIP(conn),"\n"
riveraa@dpi:~/Projects/sb $ ./sb.AppImage socktest.bas
Active IP: 192.168.1.64
For most cases, the built-in SOCKET should suffice, this is more for those instances when you need more configuration options (like UDP support).
AIR.