Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- Network class: The Network class provides the infrastructure to allow the client and the server to process the transactions. The client and the server
- Network class: The Network class provides the infrastructure to allow the client and the server to process the transactions. The client and the server need to be connected (using connect()) to the network prior to an exchange. The Network class also implements an input buffer (inComingPacket[]) and an output buffer (outGoingPacket[]) to respectively receive transactions from the client and to return updated transactions to the client. The capacity of these buffers are 10 elements, so the network indicates whether they are full or empty. - Client class: The Client class reads all the transactions from a file (transaction.txt) and saves them in an array (transaction[]). A transaction is implemented by the Transactions.class. Using the send() method of Network class the client transfers the transactions to the network input buffer and it yields the cpu in case the network input buffer is full. Also, using the receive0 method of Network class the client retrieves the updated transactions from the network output buffer and yields the cpu in case the buffer is empty. Fach updated transaction received is displayed immediately on the streen. - Server class: The Server class reads all the accounts from a file (account.txt) and saves them in an array (account[]). An account is implemented by the Accounts class. Using the transferrln() method of Network class the server retrieves the transactions from the network input buffer and performs the operations (withdraw, deposit, query) on the specific accounts. It yields the epu in case the buffer is empty. Fach updated transaction is transmitted to the network output buffer using the transferOut() method of Network class and the server yields the epu in case the buffer is full. - Network class: The Network class provides the infrastructure to allow the client and the server to process the transactions. The client and the server need to be connected (using connect()) to the network prior to an exchange. The Network class also implements an input buffer (inComingPacket[]) and an output buffer (outGoingPacket[]) to respectively receive transactions from the client and to return updated transactions to the client. The capacity of these buffers are 10 elements, so the network indicates whether they are full or empty. - Client class: The Client class reads all the transactions from a file (transaction.txt) and saves them in an array (transaction[]). A transaction is implemented by the Transactions.class. Using the send() method of Network class the client transfers the transactions to the network input buffer and it yields the cpu in case the network input buffer is full. Also, using the receive0 method of Network class the client retrieves the updated transactions from the network output buffer and yields the cpu in case the buffer is empty. Fach updated transaction received is displayed immediately on the streen. - Server class: The Server class reads all the accounts from a file (account.txt) and saves them in an array (account[]). An account is implemented by the Accounts class. Using the transferrln() method of Network class the server retrieves the transactions from the network input buffer and performs the operations (withdraw, deposit, query) on the specific accounts. It yields the epu in case the buffer is empty. Fach updated transaction is transmitted to the network output buffer using the transferOut() method of Network class and the server yields the epu in case the buffer is full
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started