Server program written in Tcl using sockets
Archive - Originally posted on "The Horse's Mouth" - 2015-03-13 16:56:50 - Graham EllisTcl includes socket libraries so that you can write your own clients and servers. Our recommendation is that you stick with standard protocols and use packages such as http rather than inventing your own - however, there might be occasions and on that basis we've got examples on our Tcl Programming course and web site - source here.
This application is a gift server - you connect in and pass in a gift (it's a good way to move something that you don't want on) and you'll be given back in return whatever it was that the previous person donated.
Here's the server display (upper window) and the client session I was running:

Code (link avove) is documented ... you'll possibly want to handle multiple concurrent connections, timeouts, etc, for real live application - but the starting point is these principles.