Steps involved in making a TCP connection

I am 18 and about to go to college for CS, I know nothing about socket programming in C.

I read the man pages on sockets, can you tell me if I got the steps right?

Server Steps:

  • create a socket with socket()

  • create an address with a struct [presumably using some kind of sockaddr struct variant]

  • bind the socket to the address with bind()

  • listen for a connection with listen()

  • accept the connection, and move the connection to another socket using accept() to free up the original "listening" socket

  • use read() and write() to communicate over the new socket

Client Steps:

  • create a socket with socket()

  • specify the address of the server we want to connect to [presumably using some sockaddr struct variant]

  • connect the socket to the address using connect()

  • use read() and write() to communicate over the socket

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum