I want you to implement in C Sockets the following scenario:
Imagine you have a modern PDA/phone and an area is covered by
3 services (e.g. 2G, 3G, Wifi).
Each area has a server called Server_2G , Server_Wifi, Server_3G that u will implement that provides the following information...
## Deliverables
I want you to implement in C Sockets the following scenario:
Imagine you have a modern PDA/phone and an area is covered by
3 services (e.g. 2G, 3G, Wifi).
Each area has a server called Server_2G , Server_Wifi, Server_3G that u will implement that provides
the following information:
Server_2G
---------
Service - high quality Price - Low quality Price
----------------------------------------------------------
[login to view URL] Call - 1 - 0,5
[login to view URL] Call - 3,7 - 1,7
[login to view URL] Streaming - 3,9 - 1,9
[login to view URL] Streaming - 4,15 - 2,15
[login to view URL] browsing - 2 - 1
Server_3G
---------
Service - high quality Price - Low quality Price
----------------------------------------------------------
[login to view URL] Call - 1,2 - 0,6
[login to view URL] Call - 3,2 - 1,9
[login to view URL] Streaming - 3,1 - 1,4
[login to view URL] Streaming - 4,85 - 2,35
[login to view URL] browsing - 2,30 - 1,1
Server_Wifi
-----------
Service - high quality Price - Low quality Price
----------------------------------------------------------
[login to view URL] Call - 0,6 - 0,25
[login to view URL] Call - 4,2 - 1,8
[login to view URL] Streaming - 2,9 - 1,3
[login to view URL] Streaming - 4,15 - 2,25
[login to view URL] browsing - 2,10 - 1,0
Then there is another CENTRAL SERVER that contains a list
of available Service Servers. The info that CENTRAL SERVER will procvide
is (name of service, ip address, port):
Network_2G [login to view URL] 1977
Network_3G [login to view URL] 1978
Network_Wifi [login to view URL] 1979
The last part is the CLIENT.
It will connect with CENTRAL SERVER and receive information about available servers.
So it will receive:
'Network_2G [login to view URL] 1977
Network_3G [login to view URL] 1978
Network_Wifi [login to view URL] 1979'
The CLIENT will then connect with each server, connect to Server_2G on IP [login to view URL] and receive the data of Server_2G
etc, etc and totally get the data from all the three tables above
-------------------------------------------------------------------------------------------
To summarize the above. You will implement
+Central_Server.c
+Server_2G.c
+Server_3G.c
+Server_wifi.c
+Client.c
The scenario is :
-----------------
1. I will run all 4 servers.
2. I will run the client (by issuing ./client [login to view URL])
3. The client will receive the IP and port that all 3 service servers from the central_server (2G,3G,Wifi)
4. The client will connect to each of the above service servers and get the data in the tables (all prices per service)
5. The client will display the following menu to the user:
1. Audio Call
2. Video call
3. Audio streaming
4. Video streaming
5. Web browsing
Please select the service you want to use:
and the user will make his selection.
6. The user has made his selection and this is the final *important* task. The client holds the following array:
Service - Utility for HIGH - Utility for LOW
Audio Call - 16 - 11
Video Call - 14 - 9
Audio Streaming - 15 - 10
Video Streaming - 16 - 11
Web browsing - 16 - 15
You will implement a function that selects the BEST server and the BEST Quality of service.
The BEST server + quality is the one that the
subtraction of 'utility - price' is the BIGGER
For example if user wants 'Audio Call' the
BEST Server --> Server_Wifi
BEST Quality --> HIGH (because 16 - 0,6 is the largest)
7. The client sends a socket message to the relevant server (Server_Wifi) telling it will use the relevent Quality (HIGH) of the selected service (Audio Call).
and a message to the rest of the servers telling them that it will not use them.