
*note: can be connect()'d if we really want.

No connection needed: datagram sockets also use IP for routing, but they don't use TCP

We just build a packet, put an IP header on it with destination information, and send it out. We don't have to maintain an open connection as we do with stream sockets. The most common types are stream sockets and datagram sockets. There are several different types of socket that determine the structure of the transport layer. The server creates it using the system call socket(), and it can't be shared with other processes. Machines can communicate, both must create a socket object.Ī socket is a resource assigned to the server process. (If we can use anology, IP address is the phone number and the TCP port is the extension).Ī socket is an object similar to a file that allows a program to accept incomingĬonnections, make outgoing connections, and send and receive data. In other words, they know how to send bits to each other.Ī socket connection means the two machines have information about each other, including network location (IP address) and TCP port. Those two pieces of software know how to communicate with each other. What's a connection? A relationship between two machines, where two pieces of software know about each other. To connect to another machine, we need a socket connection. Otherwise, we'll have port conflicts, where multiple programs attempt to bind to the same port numbers on the same IP address using the same protocol.

