|Top Previous Next|
Below is your first project in its entirety. You can just copy/paste it into the main.tbs file.
Few code comments:
•The sys_on_sys_init event handler prepares a single listening TCP socket.
•The sock_on_sock_data_arrival event handler takes whatever is received by the TCP socket and sends it back.
•The sock_on_sock_event event handler is not actually necessary for the echo application. We added this because we wanted to have the proverbial "HELLO WORLD" somewhere. The string is sent whenever a TCP connection is established.
Notice how small your first Tibbo BASIC program is! This is the power of Tibbo BASIC (and C) — you accomplish complex things in very few lines of code.