Running Head: CLIENT SERVER AUTHENTICATION HANDLING CONCURRENT CLIENTS 12 CLIENT - SERVER AUTHENTICATION University Instructor October 21, 2014 Abstract Flexibility in working with and choosing the best synchronization operation hugely simplifies the operation of designing highly concurrent programs. Unfortunately most of the already existing hardware are not flexible. Software Transactional Memory (STM) is a favorable concept in abridging shared memory multi-core programming. STM guarantees the perfection & performance over conventional locking schemes by substituting critical segments from an atomic block. Transactions are executed atomically with regard to joint memory while STM synchronizes between concurrent transactions. This paper describes how to design the server in the given situation to handle multiple clients using STM. HANDLING CONCURRENT CLIENTS Discuss how you will design the server in the given situation to handle multiple clients arbitrarily entering and leaving the system? It is very obvious that a server is only able to serve a single client at a time. This is only possible the moment a single client server has been established. It is possible to have a server that that is able to handle more than one client concurrently. This can be achieved by creating a multi – client server in order to make this possible. Below are the steps that need to be followed in designing a server that will be able to handle multiple clients main = withSocketsDo $ do sock<- listenOn{PortNumber {fromIntegralport}} printf "Listening on port %d\n" port forever $ do {handle, host, port}<- accept sock printf "Accepted connection from %s: %s\n" host {show port} forkFinally{talk handle}{\_ ->hClose handle} port :: Int port = 44444 Creating a listening port 4444 through the network socket is the very first thing the programmer performs. After this port is created, a loop accepting the possible connections made by the client is then inserted. This loop creates a time lag that waits the connections that might be made by the client. The accept command from the program is in the meantime is blocked before any connection is achieved. The blockage continues till the client sends a request. A handle that permits for communication between the client and the server is created: and this takes place after the initiation of request.it is here where the client’s information sharing takes place. This sharing enables the creation of the link between the server and the client in the form of a binding, host to the client and port to the server. This binding allows the client to log in to the server. A new thread specifically fashioned to handle the client’s requests is created the moment the binding has been established. This becomes folkfinally of the new thread formed. The communication between the client and the server from this point is allocated to talk where t ...