You are to write two programs: A client program that will connect with your server and send it… 1 answer below »

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadlines.


Order a Similar Paper Order a Different Paper

Your Programs

You are to write two programs:

1. A client program that will connect with your

server and send it requests for the weather report

for a given city.

2. A server program that will wait for connection

requests from your client and exchange one-line

text messages with it.

The Server Program

Your server must start by reading in a file named

weather20.txt that will contain a list of cities with their

next day maximum temperatures and sky conditions as in:

Amarillo,61,Sunny

Austin,76,Partly Cloudy

Corpus Christi,79,AM Thunderstorms

Dallas,65,Sunny

El Paso,67,Sunny

Galveston,69,Thunderstorms

Houston,77,AM Thunderstorms

San Antonio,79,Mostly Cloudy

with the three field separated by commas. It should then

prompt for a port to listen to as in

Enter server port number: 2468

It will then create a stream socket, bind it to the

specified port number, do a listen() to specify a

maximum number of queued connection requests and do

an accept() that will let it wait for connection requests.

Whenever the server accepts a connection request, it

will receive a city name and reply to the client with the

day’s maximum temperature and sky condition.

Additionally—and for debugging purposes—the server

should print out the name of the city in the client request,

its next day maximum temperature and its sky condition

as in:

Attachments:

Do you need help with this or a different assignment? We offer CONFIDENTIAL, ORIGINAL (Turnitin/LopesWrite/SafeAssign checks), and PRIVATE services using latest (within 5 years) peer-reviewed articles. Kindly click on ORDER NOW to receive an A++ paper from our masters- and PhD writers.

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper