Sockets

A communication channel via sockets may take one of two major forms:

  1. Connection-oriented: simulates a telephone connection. All the data that is sent down the connection are guaranteed to arrive in good condition at the other end and to be delivered to the receiving process in the order in which they were sent. Such a mechanism verifies all packets sent, re-sends packets if necessary, and arranges the received packets in the proper order before delivering them to the receiving process. Performing all these checks consumes extra time. Example of a mechanism: TCP (= Transmission Control Protocol.)
  2. Connectionless: simulates individual telegrams. There is no guarantee that any particular datum will get through undamaged (if at all) and no guarantee that the data will get delivered in any particular order. There may even be duplicate copies of the data delivered, depending on how the intermediary connections are configured. Such transmissions are much faster connection-oriented ones, but apps must implement their own error-checking and recovery procedures. Example of a mechanism: UDP (= User Datagram Protocol.)