Network messenger in 22 lines
Example for TCP/IP communications.
In this project we'll build a messenger application, capable to send and receive string message
over a TCP/IP network.
Design rack in Rack Designer, or you may download example archive which contains the
messenger rack (see screenshot on the left side of this article).
Write or open in Easy Control this script code :
#Open rack. Don't forget to write the correct path to file
#Wait untill activate check led to be checked
#Open TCP server
#Check if activate was not uncheck (this is in the main loop)
#If it is so, close TCP server and go to start
#Check if we have to send a message (button send is pressed)
#If yes, send message
#Check if we have something in the TCP buffer
#If we have, display the message and flush the TCP buffer
#And go again, and again...
Don't forget to fill local port, remote ip and remote port with correct data.
For local testing (on the same machine), start two instances of Easy Control and
fill the fields as it is in the screenshot (same IP address: 127.0.0.1, reversing
Download this project :
Well, check for data integrity, timeouts, visual enhancements,...