Python slides is at:
https://docs.google.com/presentation/d/1qIHJc4Z3KW1FtQqrcu8uMHQoEbfej2yltGDHwPaPabU
Files used is in the attachment at the end of page.
note:
The above UDP/TCP servers are very simple minded. In reality, almost all real applications serve many clients at the same time. A single thread UDP server may be able to serve many clients as long as workload is not heavy. That's the situation with DNS server. However, simple TCP server won't work for multiple clients. TCP has "connection". So, it keeps track of each connections. A single thread server is not scalable.
Many TCP servers use a separate thread for each new client. That's a subject related to OS programming. Knowing OS is essential to become a good programmer :-)
Keep on Learning.
Client Server on Different Machines
The same UDP program can be exercised on different machines as shown below. I have a Raspberry Pi (named frankRPI) on my home network. I ran UDP echo server on frankRPI and UDP echo client on my PC. The server printout shows client PC has ip address of 192.168.0.147 and port 52386.
Note that both server and client codes need to be modified to run on separate machines (because of two ip addresses). The server code uses ip address of 0.0.0.0 which means "this" machine. The client code uses frankRPI because the name is assigned to the Raspberry PI. Alternatively, one can use the real ip address (actually 192.168.0.199 on my home network).
Note: can outside people run client to frankRPI server? YES, it can. But more work needs to be done in home network because of public/private ip address and port forwarding issues.