Sockets Defined

A socket is a software concept for a connection. Sockets enable applications to connect to a TCP/IP network.

An application running on a host creates a socket or doorway to connect with an application on another host. Messages pass through this doorway or socket.

Click image to enlarge.

Sockets Enable Virtual TCP or UDP Connections Between Hosts

Sockets enable virtual TCP or UDP communication channels between hosts.

When an application starts on a host, a port number is assigned to a process or function running in it. When that application wants to communicate with another host (go to a website for example) a socket is created.

This example shows three applications requiring three TCP communication channels: Two channels for each of the two web browsers acting as HTTP clients, and one for the email application acting as an SMTP client.


Sockets Implemented as TX & RX buffers

Sockets are physically implemented as Tx & Rx memory buffers.

When an application wants to transmit a message, a process writes to the socket’s transmit buffer. This same process periodically checks the socket’s receive buffer for messages being sent by the host on the other end of the virtual connection.

The Transport layer delivers messages to the application by writing them to the socket’s receive buffer. The Transport layer also periodically polls the socket’s transmit buffer to determine if there are messages to send.


20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.