TUTORIAL C BUILDER HOW TO
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.
TUTORIAL C BUILDER SOFTWARE
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. Only one process may bind to a specific IP address and port combination using the same transport protocol.It is the socket pair (the 4-tuple consisting of the client IP address, client port number, server IP address, and server port number) that specifies the two endpoints that uniquely identifies each TCP connection in an internet.In particular, firewalls are commonly configured to differentiate between packets based on their source or destination port numbers as in port forwarding. The port numbers are encoded in the transport protocol packet header, and they can be readily interpreted not only by the sending and receiving computers, but also by other components of the networking infrastructure.The purpose of ports is to differentiate multiple endpoints on a given network address.A TCP connection is defined by two endpoints aka sockets.A TCP socket is not a connection, it is the endpoint of a specific connection.Well, we make a call to the socket() system routine.Īfter the socket() returns the socket descriptor, we start communicate through it using the specialized send()/recv() socket API calls. Where do we get the file descriptor for network communication?.Socket is a way of speaking to other programs using standard file descriptors.