Get latest Update ! Subscribe Now !




How to create Server Using Socket and press Enter to shutdown the server python socket? (Threading, Socket, Time, Keyboard, Server)

Required Libraries/Modules :

Socket: A network socket is a two way communication structure that enables the two way communication.

time

threading

keyboard





Define Variables :



Define Function that shutdown the sever as :





Define Server and Client connection which start the communication between two end points :






Close the connection on keyboard enter button pressed :



Creating threads and start the server :





Output :

Socket Server Side

Client using Telnet