Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This assignment requires the analysis, implementation, testing and documentation of two C programs that run C on the Linux server ruby (you may develop your

This assignment requires the analysis, implementation, testing and documentation of two C programs that run C on the Linux server ruby (you may develop your programs on your own Linux box or virtual machine as long as they run on ruby). A server program and a client program will be run concurrently.

Server program:

The server program provides a simple search for a specific value in an array sent to it from a client. If the value appears in the array, the server indicates the index of the first occurrence of that value in the array. The server sends the client search value and its array position. If the value does not occur in the array, only the search value and an appropriate return code is returned to the client.

The server program needs to:

  • Determine an integer value to be searched for
  • Create a well-known FIFO, named FIFO_to_Server through which the server reads inputs from the client
  • Open FIFO_to_Server in READ mode
  • Read a request from a client that includes a struct containing a size integer and array values of that size, all integers.
  • Find the index (start counting with zero) of the search value, if one exists
  • Create a FIFO named FIFO_to_Client through which the server responds to the client
  • Open FIFO_to_Client in WRITE mode
  • Write the search value and the index position back to the client through FIFO_to_Client
  • Close FIFO_to_Client
  • Unlink FIFO_to_Client
  • Close FIFO_to_Server
  • Unlink FIFO_to_Server

Client Program:

The client program will request an array size and array elements to fill the array. The client program should:

  • Open FIFO_to_Server in WRITE mode
  • Prompt the user for an array size
  • Prompt the user for elements to fill that array
  • Write the struct that includes the array size and the array to FIFO_to_Server
  • Close FIFO_to_Server *
  • Open the FIFO_to_Client in READ mode
  • Read the response from the server from FIFO_to_Client
  • Print a message such as The value 87 occurs in array position 4
  • Close FIFO_to Client

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions