Question
Make an airplane ticketing system in C language using sockets. The clients will make a request to buy a ticket from the system. The system
Make an airplane ticketing system in C language using sockets.
The clients will make a request to buy a ticket from the system. The system - server will inform them whether there are enough tickets available or not and, if there are enough available, it will proceed to complete the order and withhold the seat. Define the number of available tickets at 100.
At the end of the program print the amount of tickets that have been bought and the amount of orders that were not completed.
For the orders passed from the clients to buy a ticket use sockets (Clients will write to the socket and the Server will read).
To inform the client about the ticket availability use sockets (Clients will read from the socket and the Server will write).
To check the program create 10 different clients. Each one of them will send 2 different orders to buy a ticket. Between orders add a 1 second wait using the system call sleep().
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