Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS 3030 Scripting Languages Lab 8: Sockets Introduction Lab 8 introduces you to network communications in Perl. Your simple Perl script will contact a given

image text in transcribed

CS 3030 Scripting Languages Lab 8: Sockets Introduction Lab 8 introduces you to network communications in Perl. Your simple Perl script will contact a given server on a given port number (using protocol TCP), read the first line sent by the server and display it on the terminal. Requirements Your Python script shall be named~/cs3030/lab8/socket.pl and be marked executable. Usage: ./socket.pl HOSTNAME SOCKETNUMBER Issue an appropriate message to STDERR and exit with a non-zero return code if it fails to connect to the provided socket at the provided host. . . Issue a usage message to STDERR and exit(1) if the socket parameters are not provided. HOSTNAME can be a name such as www.google.com or an IP address such as 137.65.1.1 Test your script on icarus with "./socket.pl localhost 25" which should print something like "220 icarus.cs.weber.edu ESMTP Postfix". Print just one line and exit(0). Your script must not hang or run more than a few seconds unless it times out attempting to connect to an unknown host or a n invalid socket number . It is acceptable to use dieO, but warning: your return codes will be unpredictable.. Helpful Hints * Refer to the simple client in perlipc.pdf (located in the Reference folder) as a guide Use the socketO call to create a connection to the requested port on the server Read just one line and exit. If you loop (as in the simple client) your script may hang. Use print to output the received line to STDOUT SARGV[O] is the first argument (hostname), etc. .SARGV] contains the commandline arguments. $ $#ARGV is the index of the last item in $ARGV Run cucumber to determine your grade tar xvf/var/classes/cs3030/lab8/cuke.tar ./cucumber -s Files For this lab you will have created folder lab8 and the following executable files: socket.pl

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven NoSQL Databases In A Week Get Up And Running With The Fundamentals And Functionalities Of Seven Of The Most Popular NoSQL Databases

Authors: Aaron Ploetz ,Devram Kandhare ,Sudarshan Kadambi ,Xun Wu

1st Edition

1787288862, 978-1787288867

More Books

Students also viewed these Databases questions

Question

Describe the primary functions of lymph.

Answered: 1 week ago

Question

What do you understand is meant by OHSAS 18001?

Answered: 1 week ago