Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Refer to Figure 1 - A snippet of code. There are fourteen deliberate errors introduced in this code; eleven of the errors are identified with

image text in transcribed

Refer to Figure 1 - A snippet of code. There are fourteen deliberate errors introduced in this code; eleven of the errors are identified with XXXX and three relate to the sequencing of the Socket Primitive calls. You are required to: (1) Replace the values XXXX with the correct code. Use the line numbers to identify where your corrections are made. Note the text "XXXX" is merely a placeholder and does not signify the same code to be replaced in each instance. (10 marks) (1) Identify the correct line number where the out-of-sequence Socket Primitive calls (and any other lines normally associated with that primitive call) should be placed. (6 marks) (ID) Identify the type of application this is: client or server. Also, identify what application layer protocol it is adhering to and the next socket primitive to be called in relation to this application layer protocol. (4 marks) 1. 2. 11 connect (Xxxx, (SA ) &servadde, sizeof(servadd)) h_addr_list; 12. bzero (XOCX, sizeof(XIX)); 13. servaddr.sin family = AF INET; 14. servaddr.sin port - docx (atoi (argv[2])); 15. mencpy(servaddr.sin_addr, yox, sizeof(2000X)); 17. if ( socked - socket (OX, SOCK_STREAM, 0))

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions