on StartUP 'sub executed when the program starts
hide this stack 'this because the language used is based on stacks and has a GUI by default
accept connections on port 8000 with message "clientConnected" 'starts the socket server
end StartUP
on clientConnected pSocket
read from socket pSocket with message "messageReceived" 'will call the sub when a client is connected
end clientConnected
on messageReceived pSocket, pMsg 'psocket is the socket, pMsg is the message's string
write pMsg to socket pSocket 'sends the message back
read from socket pSocket with message "messageReceived" 'creates the loop to receive
end messageReceived