Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description: You will implement a client/server multi-threaded bank application that responds to TCP requests. The services provided by the server include (displayed as a menu

image text in transcribed
Description: You will implement a client/server multi-threaded bank application that responds to TCP requests. The services provided by the server include (displayed as a menu to the client) 1. Create an account (account number is generated by the server and returned to the client) 2. Delete an account 3. Liss the number of accounts (the server can create up to MAX_ACCOUNTS) 4. Display balance for some account 5. Deposit some amount into an account 6. Withdraw some amount from an account Your server should wait for requests on some port provided on the command line. In addition, you need to use server name and service name in your code rather that its IP address and port number. That is, you need to edit the /etc/hosts file in your client machine and add a line that specifies the server name as nedll file_server and assign it the IP address of your server machine. Also, you need to edit the /etc/services in your client machine and add a line that specifics the port name as amp and assign it the value 24053. Your code you should use the appropriate functions to convert between hostrames IP addresses and serviceport. See the man page of the files for more information The client program should be composed of two threads One displays the menu, reads user input, and sends request to the servers. The other reads response from server and display result on the terminal. On the other hand, the server is multithreaded such that each client is handled by a thread. In addition, the server should not allow the number of accounts to exceed the value of MAX ACCOUNTS. Note that more than one client can connect to the server at the same time. That is, cach thread is doing a specific request for a specific client. Accounts numbers are two digits. As a result, the MAX-ACCOUNTS variable is limited to 100 in this case. The list of accounts and balances are kept on the server on some file. The server need to make sure that this list is loaded when start running the server, and frequently saved to the file in case the server crashed for some reason. The client when sending a request should indicate request type and any other parameters required (such as account number in some operation). Furthermore, the client should output to the user informative results (not just throwing numbers on the screen) Your client program should display a menu to the user to select from as following 1. Create an account 2. Delete an account 3. list number of customers accounts ) 4. Display balance for some account 5. Deposit from an account 6. Deposit into an account 7. Exit Once an option is entered by the user the service is performed, and then the user is presented with the menu again. This operation is repeated until the user selects Exit option. Note that options 2. 4. 5. 6 requires the user to enter a valid account number. For option one, the server chooses one of the available numbers and assign it to the newly created account

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions