Write two separate c programs for client and server

Assignment Help Computer Engineering
Reference no: EM132081431

You need to write 2 separate C programs, a client & server. The client makes a connection to the server and transmits a series of numbers. The server listens for client communication and when it has received the series of numbers, it adds them together and closes.

Program requirements:

1. The client needs to know the server IP address and port number. Determine these from the server and make sure if you run the server, followed by the client that they can communicate. If you run both on the same server, any port above 1024 is valid.

2. Client code: prompt the user for how many numbers to add together, then prompt them for each number. Conversion from string to integer must be done on the client.

3. Server code: Display each integer immediately after it is entered on the client. When the client is ?nished sending numbers, the server code should add the numbers together, display the total, and then shutdown.

(Hint: If you establish a new connection on the server for every number transmitted, the server may need a pipe to communicate numbers from the child processes to the parent process. If you transmit all of the numbers in a single connection, you probably will not need to do this.)

4. Close all sockets on the server and client when ?nished. Make sure all child processes are closed.

$ ./client localhost 7500

How many numbers should I add together? 2

Enter a number: 99

Enter a number: 45

$ ./server 7500

Received number 1: 99

Received number 2: 45

Here are the numbers added together: 144

Reference no: EM132081431

Questions Cloud

Write a program that reads from the console : Write a program that reads from the console, a person's first name, current age, and a year in the future and then displays the person's name.
Write a function called lowertrim that takes two arguments : Write a function called lowerTrim that takes 2 arguments: x and trimBelow. This function takes the average of those values in x .
Fail?er considering? employees and ?leaders : ?Around 200,000 Motrin liquids which are used for infants was recalled by ?the ?j?ohnson? and john?son ?company because it contained particles of plastic.
Shanetta and crystal are general partners : One Saturday, Crystal was doing Lynette's hair when she accidentally caused a second degree burn to her scalp. Lynette began bleeding and screamed in pain
Write two separate c programs for client and server : Write 2 separate C programs, a client & server. The client makes a connection to the server and transmits a series of numbers.
Business together selling t-shirts : Jake and Mike decided to go into business together selling T-shirts. Jake was the general partner while Mike was the limited partner. Mike invested
There any theory available to him to recover something : If you believe that XXX will not succeed for breach of contract, is there any theory available to him to recover something?
What can we make of fukuyama famous projections : What can we make of Fukuyama's famous projections about the impacts of technology on social and cultural spheres?
Discovery phase of a trial : What are some of the key devices/instruments a litigant can use during the discovery phase of a trial?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Discuss the textbook author suggest for leaving employees

What policy does the textbook author suggest for leaving employees

  How various bit strings of length 6

How several bit strings of length 6 is there that begin with 0 or end with a 1. How various bit strings of length 6.

  Develop the logic for a program that read in customer record

Develop the logic for a program that reads in 100 customer records and stores the first and last names and total purchases in three parallel arrays.

  How are the tools used specifically to improve performance

How are these tools used specifically to improve performance? How does each tool function with regard to network reliability testing?

  Formal risk assessment of the external server

As part of a formal risk assessment of the external server in a small Web design company, you have identified asset "integrity of the organization web server and the threat hacking and defacement of the web server.

  Describe data, information, and decision making

assume you are a DBA staff member. What data dimensions would you describe to top-level managers to obtain their support for the data administration function.

  How to write a class named dayofyear that gets an integer

How to write a class named DayOfYear that gets an integer Day 2 would be January 2 Day 32 would be February 1 Day 365 would be December 31

  Reconfigurable computing

Implement the Boolean function given below using minimum number of function generators (F, G) of XC2000. Draw the K-maps for the function and write the expression.

  Design a fast method for determining for the lca

Design a fast method for determining p(u) for the lowest common ancestor (LCA), u, of two nodes v and w in T, given p(v) and p(w).

  Review problem on software development

Software development is a complex task, especially as technology changes at the speed of light, environments evolve, and more expectations are placed.

  Launching the radical innovation

Assume you wish to launch the radical innovation. You have the working prototype and have begun to test the early adopter market.

  Program to print the chain of numbers

Write down the program that prints out the chains for numbers within the range which the user specifies. The length of each chain must be printed at the end of the chain.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd