diff_months: 27

Investigating multi threading programming using TCP sockets Assignment

Download Solution Now
Added on: 2023-07-07 06:30:07
Order Code: //fb
Question Task Id: 0
  • Country :

    Australia

Goal:

investigate multi threading programming using TCP sockets

Description:

You are required to implement a multi-threaded client/server bank application that responds to TCP requests. The server will accept TCP requests on a port which is passed as an argument in the command line when starting the server. To pass the port, you need to use service name rather than port number (see below).

Server-Side:

The server implements a bank application that provide the following services:

  1. Create an account (account number is generated by the server and returned to the client)
  2. Delete an account (the user enters the account number)
  3. List the number of accounts created so far (the server can create up to MAX ACCOUNTS)
  4. Display balance for some account (the user enters the account number)
  5. Deposit some amount into an account (the user enters the account number and the deposit amount)
  6. Withdraw some amount from an account (the user enters the account number and the withdraw amount)

Each of these services should be implemented in a separate thread. That is, when a client connects, the server creates a thread to server that specific client. That thread creates a new thread for each request sent from that client. This new thread should perform the requested service and return appropriate result is back to the client. In the case an error occurred, the error should be returned to the client also.

The server should not allow the number of accounts to exceed the value of MAX ACCOUNTS. For this assignment define MAX-ACCOUNTS to be 5. In addition, cach account number is composed of two digits. So valid account numbers are between 10 and 15.

The list of accounts and balances are kept on the server on some file, called accounts.txt. this file is loaded when the server starts, and saved every 5 seconds to the file in case the server crashed for some reason.

To run the server, you need to specify the service name (rather than the port number) on the command line. To so, you need to edit the /etc/services in your server machine and add a line that specifies the port name as bank port and assign it some value based on your students ID. To avoid conflict when working on the course server, each student is required to use a port number for the server using the following format: 55abe for its connection, where abe is the least significant 3 digits of your students ID. For example, a student whose ID is 12345 will have the server listening port 55345

Client-Side:

Once the client starts, it displays a menu for the user to select services from as follows:

  1. Create an account
  2. Delete an account
  3. List number of accounts (customers)
  4. Display balance for some account

Are you struggling to keep up with the demands of your academic journey? Don't worry, we've got your back! Exam Question Bank is your trusted partner in achieving academic excellence for all kind of technical and non-technical subjects.

Our comprehensive range of academic services is designed to cater to students at every level. Whether you're a high school student, a college undergraduate, or pursuing advanced studies, we have the expertise and resources to support you.

To connect with expert and ask your query click here Exam Question Bank

  • Uploaded By : Katthy Wills
  • Posted on : July 07th, 2023
  • Downloads : 0
  • Views : 387

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan

Premium

80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing
Most
Popular

Gold

30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%

Silver

20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more