SlideShare a Scribd company logo
1 of 3
Download to read offline
Exercise:
You will use the TCP echo client and server code (for IPv4 version) from Donahoo. You
will modify the code to do the following. Instead of transmitting a string (passed from the
command line) from client to server, you will pass a text file as a command line argument,
and transmit the contents of that file to the sender line by line, including line numbers.
(Sample file is attached to Canvas). The rest of the arguments will remain the same.
While sending data, client will echo it line by line to the screen, along with line numbers.
Please keep in mind that your program should work with any file, not just the one that
was provided, so hard-coding will not be a good idea. The server will receive the entire
file, buffer it until it has the entire contents, and then reverse it and echo (print) it to the
standard output (screen). Each revesed line of text will have the correct line number. The
last character of the original file will be the first one in the reversed version except line
numbes. After that you will print a goodbye message from both the client and the server
and close the connection.
It is up to you to figure out the details. There are several different solutions to this
problem, and everyone's solution may be different. I do recommend that you review how
to read from files in C and go over the code line by line following the Chapter 2 in Donahoo.
Starter Code:
TCPEchoServer4.c:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "Practical.h"
#include <unistd.h>
static const int MAXPENDING = 5; // Maximum outstanding connection requests
int main(int argc, char *argv[]) {
if (argc != 2) // Test for correct number of arguments
DieWithUserMessage("Parameter(s)", "<Server Port>");
in_port_t servPort = atoi(argv[1]); // First arg: local port
// Create socket for incoming connections
int servSock; // Socket descriptor for server
if ((servSock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
DieWithSystemMessage("socket() failed");
// Construct local address structure
struct sockaddr_in servAddr; // Local address
memset(&servAddr, 0, sizeof(servAddr)); // Zero out structure
servAddr.sin_family = AF_INET; // IPv4 address family
servAddr.sin_addr.s_addr = htonl(INADDR_ANY); // Any incoming interface
servAddr.sin_port = htons(servPort); // Local port
// Bind to the local address
if (bind(servSock, (struct sockaddr*) &servAddr, sizeof(servAddr)) < 0)
DieWithSystemMessage("bind() failed");
// Mark the socket so it will listen for incoming connections
if (listen(servSock, MAXPENDING) < 0)
DieWithSystemMessage("listen() failed");
for (;;) { // Run forever
struct sockaddr_in clntAddr; // Client address
// Set length of client address structure (in-out parameter)
socklen_t clntAddrLen = sizeof(clntAddr);
// Wait for a client to connect
int clntSock = accept(servSock, (struct sockaddr *) &clntAddr, &clntAddrLen);
if (clntSock < 0)
DieWithSystemMessage("accept() failed");
// clntSock is connected to a client!
char clntName[INET_ADDRSTRLEN]; // String to contain client address
if (inet_ntop(AF_INET, &clntAddr.sin_addr.s_addr, clntName,
sizeof(clntName)) != NULL)
printf("Handling client %s/%dn", clntName, ntohs(clntAddr.sin_port));
else
puts("Unable to get client address");
HandleTCPClient(clntSock);
}
// NOT REACHED
}
TCPEchoClient4.c:
Here's the sample txt file for input:
Example output
Client output:
Sending data to <IP address of the server here>:
1. Hotel California
2. .... (the rest of the file line by line including blank lines and line numbers)
....
Goodbye!!!!!
Server output:
Received data from <IP address of the client >:
34. <The text in reverse goes here line by line including blank lines>
33. ...
Goodbye!
Hotel California On a dark desert highway, cool wind in my hair Warm smell of colitas, rising
up through the air Up ahead in the distance, I saw a shimmering light My head grew heavy and
my sight grew dim I had to stop for the night There she stood in the doorway I heard the mission
bell And I was thinking to myself "This could be Heaven or this could be Hell" Then she lit up a
candle and she showed me the way There were voices down the corridor I thought I heard them
say Welcome to the Hotel California Such a lovely place (Such a lovely place) Such a lovely
face Plenty of room at the Hotel California Any time of year (Any time of year) You can find it
here Her mind is Tiffany-twisted, she got the Mercedes bends She got a lot of pretty, pretty boys
she calls friends How they dance in the courtyard, sweet summer sweat Some dance to
remember, some dance to forget.

More Related Content

Similar to Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf

Project descriptionIn this Phase, we will develop two nodes.docx
Project descriptionIn this Phase, we will develop two nodes.docxProject descriptionIn this Phase, we will develop two nodes.docx
Project descriptionIn this Phase, we will develop two nodes.docx
wkyra78
ย 
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
 INSTRUCTIONS For this assignment you will be generating all code on y.pdf INSTRUCTIONS For this assignment you will be generating all code on y.pdf
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
adayarboot
ย 
Netcat 101 by-mahesh-beema
Netcat 101 by-mahesh-beemaNetcat 101 by-mahesh-beema
Netcat 101 by-mahesh-beema
Raghunath G
ย 
Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)
nes
ย 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programming
elliando dias
ย 
study-of-network-simulator.pdf
study-of-network-simulator.pdfstudy-of-network-simulator.pdf
study-of-network-simulator.pdf
Jayaprasanna4
ย 
Rpc (Distributed computing)
Rpc (Distributed computing)Rpc (Distributed computing)
Rpc (Distributed computing)
Sri Prasanna
ย 
Netkitmig
NetkitmigNetkitmig
Netkitmig
renyufei
ย 
1-Information sharing ๏ปฟ2-Computation speedup3-Modularity4-.docx
1-Information sharing ๏ปฟ2-Computation speedup3-Modularity4-.docx1-Information sharing ๏ปฟ2-Computation speedup3-Modularity4-.docx
1-Information sharing ๏ปฟ2-Computation speedup3-Modularity4-.docx
SONU61709
ย 
Rpc mechanism
Rpc mechanismRpc mechanism
Rpc mechanism
vaishali_singh
ย 

Similar to Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf (20)

Project descriptionIn this Phase, we will develop two nodes.docx
Project descriptionIn this Phase, we will develop two nodes.docxProject descriptionIn this Phase, we will develop two nodes.docx
Project descriptionIn this Phase, we will develop two nodes.docx
ย 
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
 INSTRUCTIONS For this assignment you will be generating all code on y.pdf INSTRUCTIONS For this assignment you will be generating all code on y.pdf
INSTRUCTIONS For this assignment you will be generating all code on y.pdf
ย 
Netcat - 101 Swiss Army Knife
Netcat - 101 Swiss Army KnifeNetcat - 101 Swiss Army Knife
Netcat - 101 Swiss Army Knife
ย 
Netcat 101 by-mahesh-beema
Netcat 101 by-mahesh-beemaNetcat 101 by-mahesh-beema
Netcat 101 by-mahesh-beema
ย 
Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)Chapter%202%20 %20 Text%20compression(2)
Chapter%202%20 %20 Text%20compression(2)
ย 
Wireshark Tutorial
Wireshark TutorialWireshark Tutorial
Wireshark Tutorial
ย 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programming
ย 
Understanding TCP and HTTP
Understanding TCP and HTTP Understanding TCP and HTTP
Understanding TCP and HTTP
ย 
03 sockets
03 sockets03 sockets
03 sockets
ย 
Information gathering using windows command line utility
Information gathering using windows command line utilityInformation gathering using windows command line utility
Information gathering using windows command line utility
ย 
study-of-network-simulator.pdf
study-of-network-simulator.pdfstudy-of-network-simulator.pdf
study-of-network-simulator.pdf
ย 
Rpc (Distributed computing)
Rpc (Distributed computing)Rpc (Distributed computing)
Rpc (Distributed computing)
ย 
Netkitmig
NetkitmigNetkitmig
Netkitmig
ย 
Lec 4(packet delay layered Architecture)
Lec 4(packet delay layered Architecture)Lec 4(packet delay layered Architecture)
Lec 4(packet delay layered Architecture)
ย 
1-Information sharing ๏ปฟ2-Computation speedup3-Modularity4-.docx
1-Information sharing ๏ปฟ2-Computation speedup3-Modularity4-.docx1-Information sharing ๏ปฟ2-Computation speedup3-Modularity4-.docx
1-Information sharing ๏ปฟ2-Computation speedup3-Modularity4-.docx
ย 
CCNA Interview.pdf
CCNA Interview.pdfCCNA Interview.pdf
CCNA Interview.pdf
ย 
Simple chat room using python
Simple chat room using pythonSimple chat room using python
Simple chat room using python
ย 
0-Slot14-15-16-Libraries.pdf
0-Slot14-15-16-Libraries.pdf0-Slot14-15-16-Libraries.pdf
0-Slot14-15-16-Libraries.pdf
ย 
Rpc mechanism
Rpc mechanismRpc mechanism
Rpc mechanism
ย 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
ย 

More from deepak596396

Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdfDerive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
deepak596396
ย 
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdfDemonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
deepak596396
ย 

More from deepak596396 (20)

Describe how the bioavailability of calcium varies and then identify s.pdf
Describe how the bioavailability of calcium varies and then identify s.pdfDescribe how the bioavailability of calcium varies and then identify s.pdf
Describe how the bioavailability of calcium varies and then identify s.pdf
ย 
Describe communication choices at each stage of the speech creation pr.pdf
Describe communication choices at each stage of the speech creation pr.pdfDescribe communication choices at each stage of the speech creation pr.pdf
Describe communication choices at each stage of the speech creation pr.pdf
ย 
Describe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdfDescribe an algorithm for concatenating two singly linked lists L and.pdf
Describe an algorithm for concatenating two singly linked lists L and.pdf
ย 
Deion- a very-task oriented leader- has recently taken on a management.pdf
Deion- a very-task oriented leader- has recently taken on a management.pdfDeion- a very-task oriented leader- has recently taken on a management.pdf
Deion- a very-task oriented leader- has recently taken on a management.pdf
ย 
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdfDerive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
Derive the Hicksian demand functions for goods 1 and 2 using Envelope.pdf
ย 
D- Maintaining History The final milestone of the project is to build.pdf
D- Maintaining History The final milestone of the project is to build.pdfD- Maintaining History The final milestone of the project is to build.pdf
D- Maintaining History The final milestone of the project is to build.pdf
ย 
deram pacios) Ths 05- coridecocai inteivel bored vooa n-100 is decima.pdf
deram pacios) Ths 05- coridecocai inteivel bored vooa n-100 is decima.pdfderam pacios) Ths 05- coridecocai inteivel bored vooa n-100 is decima.pdf
deram pacios) Ths 05- coridecocai inteivel bored vooa n-100 is decima.pdf
ย 
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdfDemonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
Demonstrate your knowiedfe- Refer to the text and figures as netiod- t.pdf
ย 
D- Classifying Acids and Bases The pH of a solution is a number which.pdf
D- Classifying Acids and Bases The pH of a solution is a number which.pdfD- Classifying Acids and Bases The pH of a solution is a number which.pdf
D- Classifying Acids and Bases The pH of a solution is a number which.pdf
ย 
Deliverable- Create two single user empathy maps- as described below-.pdf
Deliverable- Create two single user empathy maps- as described below-.pdfDeliverable- Create two single user empathy maps- as described below-.pdf
Deliverable- Create two single user empathy maps- as described below-.pdf
ย 
d- By how much does the supply of money supply or contract- Supply of.pdf
d- By how much does the supply of money supply or contract- Supply of.pdfd- By how much does the supply of money supply or contract- Supply of.pdf
d- By how much does the supply of money supply or contract- Supply of.pdf
ย 
Define the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdfDefine the following terms- and explain it in your own words with exam.pdf
Define the following terms- and explain it in your own words with exam.pdf
ย 
Deinococcus radiodurans is a bacteria with a very peculiar special abi.pdf
Deinococcus radiodurans is a bacteria with a very peculiar special abi.pdfDeinococcus radiodurans is a bacteria with a very peculiar special abi.pdf
Deinococcus radiodurans is a bacteria with a very peculiar special abi.pdf
ย 
Define a method printFeetinchShort- with int parameters numFeet and nu.pdf
Define a method printFeetinchShort- with int parameters numFeet and nu.pdfDefine a method printFeetinchShort- with int parameters numFeet and nu.pdf
Define a method printFeetinchShort- with int parameters numFeet and nu.pdf
ย 
Define a method named orderOfAppearance() that takes the name of a rol.pdf
Define a method named orderOfAppearance() that takes the name of a rol.pdfDefine a method named orderOfAppearance() that takes the name of a rol.pdf
Define a method named orderOfAppearance() that takes the name of a rol.pdf
ย 
D) there is little change across horizontal distances- Question 14 (Ma.pdf
D) there is little change across horizontal distances- Question 14 (Ma.pdfD) there is little change across horizontal distances- Question 14 (Ma.pdf
D) there is little change across horizontal distances- Question 14 (Ma.pdf
ย 
Define a method findResources() that takes two integer parameters as a.pdf
Define a method findResources() that takes two integer parameters as a.pdfDefine a method findResources() that takes two integer parameters as a.pdf
Define a method findResources() that takes two integer parameters as a.pdf
ย 
Exhibit 11-7 We want to test the hypothesis that population B has a.pdf
Exhibit 11-7    We want to test the hypothesis that population B has a.pdfExhibit 11-7    We want to test the hypothesis that population B has a.pdf
Exhibit 11-7 We want to test the hypothesis that population B has a.pdf
ย 
Exercise 8 1- Discuss the relevance of the Dutch disease problem for.pdf
Exercise 8  1- Discuss the relevance of the Dutch disease problem for.pdfExercise 8  1- Discuss the relevance of the Dutch disease problem for.pdf
Exercise 8 1- Discuss the relevance of the Dutch disease problem for.pdf
ย 
EXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdf
EXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdfEXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdf
EXERCISE 7 - Let (Xn)n1 be a sequence of random variables such that Xn.pdf
ย 

Recently uploaded

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
ย 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
ย 

Recently uploaded (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
ย 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
ย 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
ย 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
ย 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
ย 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
ย 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
ย 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
ย 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
ย 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
ย 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
ย 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
ย 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
ย 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
ย 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
ย 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
ย 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
ย 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
ย 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
ย 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
ย 

Exercise- You will use the TCP echo client and server code (for IPv4 v.pdf

  • 1. Exercise: You will use the TCP echo client and server code (for IPv4 version) from Donahoo. You will modify the code to do the following. Instead of transmitting a string (passed from the command line) from client to server, you will pass a text file as a command line argument, and transmit the contents of that file to the sender line by line, including line numbers. (Sample file is attached to Canvas). The rest of the arguments will remain the same. While sending data, client will echo it line by line to the screen, along with line numbers. Please keep in mind that your program should work with any file, not just the one that was provided, so hard-coding will not be a good idea. The server will receive the entire file, buffer it until it has the entire contents, and then reverse it and echo (print) it to the standard output (screen). Each revesed line of text will have the correct line number. The last character of the original file will be the first one in the reversed version except line numbes. After that you will print a goodbye message from both the client and the server and close the connection. It is up to you to figure out the details. There are several different solutions to this problem, and everyone's solution may be different. I do recommend that you review how to read from files in C and go over the code line by line following the Chapter 2 in Donahoo. Starter Code: TCPEchoServer4.c: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include "Practical.h" #include <unistd.h> static const int MAXPENDING = 5; // Maximum outstanding connection requests int main(int argc, char *argv[]) { if (argc != 2) // Test for correct number of arguments DieWithUserMessage("Parameter(s)", "<Server Port>"); in_port_t servPort = atoi(argv[1]); // First arg: local port // Create socket for incoming connections int servSock; // Socket descriptor for server if ((servSock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) DieWithSystemMessage("socket() failed");
  • 2. // Construct local address structure struct sockaddr_in servAddr; // Local address memset(&servAddr, 0, sizeof(servAddr)); // Zero out structure servAddr.sin_family = AF_INET; // IPv4 address family servAddr.sin_addr.s_addr = htonl(INADDR_ANY); // Any incoming interface servAddr.sin_port = htons(servPort); // Local port // Bind to the local address if (bind(servSock, (struct sockaddr*) &servAddr, sizeof(servAddr)) < 0) DieWithSystemMessage("bind() failed"); // Mark the socket so it will listen for incoming connections if (listen(servSock, MAXPENDING) < 0) DieWithSystemMessage("listen() failed"); for (;;) { // Run forever struct sockaddr_in clntAddr; // Client address // Set length of client address structure (in-out parameter) socklen_t clntAddrLen = sizeof(clntAddr); // Wait for a client to connect int clntSock = accept(servSock, (struct sockaddr *) &clntAddr, &clntAddrLen); if (clntSock < 0) DieWithSystemMessage("accept() failed"); // clntSock is connected to a client! char clntName[INET_ADDRSTRLEN]; // String to contain client address if (inet_ntop(AF_INET, &clntAddr.sin_addr.s_addr, clntName, sizeof(clntName)) != NULL) printf("Handling client %s/%dn", clntName, ntohs(clntAddr.sin_port)); else puts("Unable to get client address"); HandleTCPClient(clntSock); } // NOT REACHED } TCPEchoClient4.c: Here's the sample txt file for input: Example output Client output: Sending data to <IP address of the server here>:
  • 3. 1. Hotel California 2. .... (the rest of the file line by line including blank lines and line numbers) .... Goodbye!!!!! Server output: Received data from <IP address of the client >: 34. <The text in reverse goes here line by line including blank lines> 33. ... Goodbye! Hotel California On a dark desert highway, cool wind in my hair Warm smell of colitas, rising up through the air Up ahead in the distance, I saw a shimmering light My head grew heavy and my sight grew dim I had to stop for the night There she stood in the doorway I heard the mission bell And I was thinking to myself "This could be Heaven or this could be Hell" Then she lit up a candle and she showed me the way There were voices down the corridor I thought I heard them say Welcome to the Hotel California Such a lovely place (Such a lovely place) Such a lovely face Plenty of room at the Hotel California Any time of year (Any time of year) You can find it here Her mind is Tiffany-twisted, she got the Mercedes bends She got a lot of pretty, pretty boys she calls friends How they dance in the courtyard, sweet summer sweat Some dance to remember, some dance to forget.