Question: Consider the following socket networking procedure running as the server ( i . e . not the client ) : 1 . Create network endpoint

Consider the following socket networking procedure running as the server (i.e. not the client):
1. Create network endpoint with socket()
2. Start listening for connections with listen()
3. Accept connections with accept()
4. Read and write data with read() and write()
Which of the following statements are correct? (select one or more)
Group of answer choices
accept () returns the same file descriptor as the one we create with socket() call.
In step 4, you could also use send() and recv() to send and receive data
Assuming we want to handle more than one network connection for communication after one completes, there should be a loop around steps 3 and 4
There is a missing step in between steps 1 and 2: the socket needs to be bound to a port with bind() before calling listen()
We do not use the connect() command in this server procedure; connect() is used by the client.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!