application layer: It allows applications access to network services, such as file and printer sharing, as well as file transfer and management services. This would be the layer that a programmer uses...
A port is a logical connection method two end points communicate with. Ports operate at the Transport layer of the OSI. Sockets are a means of plugging the application layer in. Sockets are determined by an IP address and port number.A socket is one end point of a connection.