Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Refer to Figure 1 (A snippel of code) and the following list of terms: MAXLINE, IPPROTO_UDP, &servAddr, SOCK_STREAM, cintSock, inet_pton, AF_INET, sock, sin port,

image text in transcribed

1. Refer to Figure 1 (A snippel of code) and the following list of terms: MAXLINE, IPPROTO_UDP, &servAddr, SOCK_STREAM, cintSock, inet_pton, AF_INET, sock, sin port, IPPROTO TCP. () Using line numbers, identify which XXXX value can be replaced with which term from the above list (12 marks) (ii) State whether this is a client or server application justifying your answer. (4 marks) (ili) If this snippet of code is derived from a Daytime application, identify the socket primitive that would be called after line 27. (4 marks) .... IGNORE ALL PRIOR LINES. AWN char *servIP - argv[i]; in port t serv Port = atoi (argv[2]); int sock = socket (AF_INET, SOCK_STREAM, Xxxx); if (socks 0) DiewithsystemMessage ("socket() failed"); struct sockaddr_in servAddr; memset (XXXX, 0, sizeof(servAddr)); servAddr.sin_family = XXXX; int rental = XXXX (AF_INET, servIP, &servAddr.sin addr.s_addr); O on in WN NNNNNNNNNH AWNPO 30 J if (runval == 0) DieWithUser Message ( "Failed", "invalid address string"); else if (runval

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What is the Bank of Canadas monetary policy objective?

Answered: 1 week ago