One way is to use the Thread class to create a new thread when a connection is made by a client.