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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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