What is a socket?












42















Could someone explain to me what a socket is? I see it in many acronyms in context of SSL, etc.



Also, why is it called a socket? Is it purely because it was what a name they invented? Or was it the first name they came up with?










share|improve this question




















  • 9





    In layman's terms: a socket is a telephone.  It's the thing that you hold in your hand that lets you have a conversation with another phone.  The analogy breaks down a little: Most phone conversations are peer-to-peer.  Socket connections are client to server.  The client (such as, but not limited to, workstation software like browsers) connects to a server (such as a web server, file server, authentication server, or other).  Another flaw in the analogy: when you close a socket connection, the socket is destroyed, and you must create a new socket before you can establish a new connection.

    – G-Man
    Mar 31 '15 at 21:31













  • It's not that bad for an analogy. A server is just a call-center and can have many hundreds of active calls at one time.

    – MSalters
    Apr 1 '15 at 13:30
















42















Could someone explain to me what a socket is? I see it in many acronyms in context of SSL, etc.



Also, why is it called a socket? Is it purely because it was what a name they invented? Or was it the first name they came up with?










share|improve this question




















  • 9





    In layman's terms: a socket is a telephone.  It's the thing that you hold in your hand that lets you have a conversation with another phone.  The analogy breaks down a little: Most phone conversations are peer-to-peer.  Socket connections are client to server.  The client (such as, but not limited to, workstation software like browsers) connects to a server (such as a web server, file server, authentication server, or other).  Another flaw in the analogy: when you close a socket connection, the socket is destroyed, and you must create a new socket before you can establish a new connection.

    – G-Man
    Mar 31 '15 at 21:31













  • It's not that bad for an analogy. A server is just a call-center and can have many hundreds of active calls at one time.

    – MSalters
    Apr 1 '15 at 13:30














42












42








42


23






Could someone explain to me what a socket is? I see it in many acronyms in context of SSL, etc.



Also, why is it called a socket? Is it purely because it was what a name they invented? Or was it the first name they came up with?










share|improve this question
















Could someone explain to me what a socket is? I see it in many acronyms in context of SSL, etc.



Also, why is it called a socket? Is it purely because it was what a name they invented? Or was it the first name they came up with?







networking history terminology socket






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 10 '11 at 0:04







chrisjlee

















asked Jul 9 '11 at 0:42









chrisjleechrisjlee

2,467123350




2,467123350








  • 9





    In layman's terms: a socket is a telephone.  It's the thing that you hold in your hand that lets you have a conversation with another phone.  The analogy breaks down a little: Most phone conversations are peer-to-peer.  Socket connections are client to server.  The client (such as, but not limited to, workstation software like browsers) connects to a server (such as a web server, file server, authentication server, or other).  Another flaw in the analogy: when you close a socket connection, the socket is destroyed, and you must create a new socket before you can establish a new connection.

    – G-Man
    Mar 31 '15 at 21:31













  • It's not that bad for an analogy. A server is just a call-center and can have many hundreds of active calls at one time.

    – MSalters
    Apr 1 '15 at 13:30














  • 9





    In layman's terms: a socket is a telephone.  It's the thing that you hold in your hand that lets you have a conversation with another phone.  The analogy breaks down a little: Most phone conversations are peer-to-peer.  Socket connections are client to server.  The client (such as, but not limited to, workstation software like browsers) connects to a server (such as a web server, file server, authentication server, or other).  Another flaw in the analogy: when you close a socket connection, the socket is destroyed, and you must create a new socket before you can establish a new connection.

    – G-Man
    Mar 31 '15 at 21:31













  • It's not that bad for an analogy. A server is just a call-center and can have many hundreds of active calls at one time.

    – MSalters
    Apr 1 '15 at 13:30








9




9





In layman's terms: a socket is a telephone.  It's the thing that you hold in your hand that lets you have a conversation with another phone.  The analogy breaks down a little: Most phone conversations are peer-to-peer.  Socket connections are client to server.  The client (such as, but not limited to, workstation software like browsers) connects to a server (such as a web server, file server, authentication server, or other).  Another flaw in the analogy: when you close a socket connection, the socket is destroyed, and you must create a new socket before you can establish a new connection.

– G-Man
Mar 31 '15 at 21:31







In layman's terms: a socket is a telephone.  It's the thing that you hold in your hand that lets you have a conversation with another phone.  The analogy breaks down a little: Most phone conversations are peer-to-peer.  Socket connections are client to server.  The client (such as, but not limited to, workstation software like browsers) connects to a server (such as a web server, file server, authentication server, or other).  Another flaw in the analogy: when you close a socket connection, the socket is destroyed, and you must create a new socket before you can establish a new connection.

– G-Man
Mar 31 '15 at 21:31















It's not that bad for an analogy. A server is just a call-center and can have many hundreds of active calls at one time.

– MSalters
Apr 1 '15 at 13:30





It's not that bad for an analogy. A server is just a call-center and can have many hundreds of active calls at one time.

– MSalters
Apr 1 '15 at 13:30










7 Answers
7






active

oldest

votes


















39














A socket is just a logical endpoint for communication. They exist on the transport layer. You can send and receive things on a socket, you can bind and listen to a socket. A socket is specific to a protocol, machine, and port, and is addressed as such in the header of a packet.



Beej's guides to Network Programming and Inter-Process Communication both have good information on how to use sockets, and even answer this exact question.






share|improve this answer

































    60














    In the simplest terms, a socket is a pseudo-file that represents a network connection. Once a socket has been created (using the proper primitives, and the proper parameters to identify the other host), writes to the socket are turned into network packets that get sent out, and data received from the network can be read from the socket.



    In one regard, sockets are very similar to pipes: they look just like files to the programs using them, but do not result in read or writes to a disk; rather, they allow communicating with another program (local in the case of pipes, and possibly remote in the case of sockets). They also offer, as you mention, bidirectional communication (much like a pair of properly connected pipes could).



    Finally, it is common for programs on a single machine to communicate using standard network protocols, such as TCP; it would be wasteful to go all the way to the network hardware (if any!), computing checksums, etc., just to go back to the same host: that's where Unix domains sockets come in. Those are much like regular sockets, except they connect processes on the same host rather than remote processes, and do not attempt to use any network resources at all. In this way, they are a medium of inter-process communication.



    As tripleee mentioned, in the course of the history of BSD, pipes were introduced earlier than sockets, and were reimplemented using sockets once those existed. The same reference, The Design and Implementation of the FreeBSD Operating System, mentions that pipes were then reverted to a non-socket implementation for performance reasons: this certainly underlines the fact that pipes share similarities.






    share|improve this answer





















    • 2





      Maybe also mention that pipes predate sockets, but once the socket interface was added to Unix, it made a lot of sense to reimplement pipes using local sockets.

      – tripleee
      Apr 1 '15 at 10:57











    • @tripleee: That's a great historical point. Care to provide a reference?

      – dhag
      Apr 1 '15 at 14:00











    • Quick googling turns up page 40 in The Design and Implementation of the FreeBSD Operating System; the text mentions this change in 4.2BSD but also clarifies that this is no longer how it's done, for performance reasons.

      – tripleee
      Apr 1 '15 at 14:12













    • Excellent, I'll add this to my answer.

      – dhag
      Apr 1 '15 at 14:15











    • The best techno answer in all

      – chaosguru
      Feb 14 '18 at 11:26



















    5














    A socket an abstraction. It provides a interface for applications to utilize a system resource (in this case the network connection) in a way that allows the operating system to mediate and organize the use of a limited resource by any number of applications.



    If the data being sent through the socket could be thought of as envelopes of mail, then the socket would be your mail box. You attach a mailbox(socket) to your house(program) and put your outgoing mail(data) into it. At a scheduled time the mailman (operating system) comes along and picks up your outgoing mail and drops off any incoming mail in the same mailbox. Your outgoing mail is conveyed on your behalf to the recipient through the mailman's truck(network connection) along with all your neighbors' mail. This allows you to correspond with people far away without the need for the expense, time, difficulty, etc. of delivering the letter yourself.



    As for why they're called 'sockets' well, the notion that the inventors get to call it whatever they want probably plays a large role there. Though, it's not a bad name in my opinion :)






    share|improve this answer































      4














      Now, what is it?



      A socket, or "socket" can be several things:



      First of all, it is a thought model and an application programming interface (API). That means you have a set of rules you need to follow and a set of functions that you can use to write programs that do something, according to a precisely specified contract. In this particular case, something means exchange data with another program.



      The sockets API widely abstracts the details of "communication" in general. It encapsulates who you talk with and how, all through one (almost) consistent and identical cookie-cutter form.

      You can create sockets in different "domains" (such as e.g. a "unix socket" or a "internet socket") and of different types of communication (e.g. a "datagram" socket or a "stream" socket) and talk to different recipients, and everything works exactly the same (well, 99%, there are obviously minute differences that you'll have to account for).



      You do not need to know (and you do not even want to know!) whether you talk to another program on the same computer or on a different computer, or whether there is IPv4 or IPv6 network in between those computers, or maybe some other protocol that you have never heard of.



      socket is also the name of the library function (or syscall) which creates "the socket", which is a special kind of file (everything in Unix is a file).



      How does it compare to...




      sockets fall into the same category as pipes and name pipes




      A pipe is a means of one way communication between a reader and a writer (both being programs) on the same computer. It simulates a stream of data (just like e.g. TCP).

      That is, no individual "messages" or "blocks of data" exist from the pipe's point of view. You can copy any amount of data into "one end", and someone else can read any amount of data (not necessarily the same, and not necessarily in one go) at the "other end" in the same byte order as you've pushed it in.



      A named pipe is, well, simply a pipe which owns a name in the filesystem. That is, it's something that looks and behaves just like a file, it appears in the directory listing and you can open it, write to it, etc etc. Note that you can also create socket special files (that would be a named socket).



      A socket, on the other hand, is a means of two way ("duplex") communication, that means you can write to and read from the same socket, and you do not need two separate sockets for a two-way communication.

      Also, a socket can act as a stream (identical to a pipe), or it can send discrete, unreliable messages, or it can send discrete, ordered messages (the first two work on any domain, the last only on "unix domain"). It can send messages (or simulate a stream) to someone on an entirely different computer. A socket can even do a form of one-to-many communication (multicast) under some conditions.



      With that in mind, it is clear that sockets do something much more complicated and generally have more overhead than pipes (which are basically no more than a simple memcpy to and from a buffer!), but if you create local sockets (i.e. on the same computer), the operating system usually applies a heavily optimized fast path, so there is really not much of a difference.




      inter-process communication
      sometimes mentioned with regard to networks




      Yes, sockets are one possible way of inter-process communication (shared memory and pipes being examples of alternatives). All at the same time, they are being used for "networking", as explained above.






      share|improve this answer































        1














        For udp or tcp over IP,



        A socket address is the combination of an IP address and a port number.



        An IP address is the address of a machine on the internet e.g. unix.stackexchange.com has address 198.252.206.140



        However each machine must be able to provide more than one service, so most machines will provide http (web pages) on port 80, and ssh on port 22, and etc.



        So unix.stackexchange.com:80 port 80 of unix.stackexchange.com (a socket) is the access point of this web site.



        However there are other types of socket, see comments below.






        share|improve this answer





















        • 5





          tcp/ip is only one kind of socket. There are others that have nothing to do with tcp/ip.

          – psusi
          Mar 31 '15 at 23:31











        • how many different kinds of sockets are there ?

          – Abdul Al Hazred
          Mar 31 '15 at 23:35






        • 1





          @AbdulAlHazred, I know of four common types used with ip networking, the same with ip6, two with unix, and two with IPX. I have not looked at ax25, atm, or appletalk. There are other protocols supported on linux, and there are protocols linux does not support. In most cases each protocol has stream(tcp) and datagram(udp) sockets. Raw sockets are also common, and imcp may also have a socket interface.

          – hildred
          Apr 1 '15 at 1:41











        • The point being, this answer is incomplete in that it only covers one type of socket, and misleading in that it represent sockets in general as if they were always network sockets, and specifically IP (AF_INET) sockets.

          – tripleee
          Apr 1 '15 at 10:55



















        0














        I believe you asked about networking. So TCP services use sockets as point for communication and are made up of an IP address, protocol and port number.






        share|improve this answer































          -1














          That's a great question, Think about it for a second... what is a socket ?



          A socket can be compared to a wall outlet/receptacle



          A socket can have a LISTEN state or an ESTABLISHED state



          A socket is a window between your server/operating system that serves you and the inter net



          A socket allows the user to connect to the outside world, "via cyber space"



          A socket is exactly as it sounds as an outlet in your home and in network, It allows a user or home owner to sock it in for access to more.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f16311%2fwhat-is-a-socket%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            7 Answers
            7






            active

            oldest

            votes








            7 Answers
            7






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            39














            A socket is just a logical endpoint for communication. They exist on the transport layer. You can send and receive things on a socket, you can bind and listen to a socket. A socket is specific to a protocol, machine, and port, and is addressed as such in the header of a packet.



            Beej's guides to Network Programming and Inter-Process Communication both have good information on how to use sockets, and even answer this exact question.






            share|improve this answer






























              39














              A socket is just a logical endpoint for communication. They exist on the transport layer. You can send and receive things on a socket, you can bind and listen to a socket. A socket is specific to a protocol, machine, and port, and is addressed as such in the header of a packet.



              Beej's guides to Network Programming and Inter-Process Communication both have good information on how to use sockets, and even answer this exact question.






              share|improve this answer




























                39












                39








                39







                A socket is just a logical endpoint for communication. They exist on the transport layer. You can send and receive things on a socket, you can bind and listen to a socket. A socket is specific to a protocol, machine, and port, and is addressed as such in the header of a packet.



                Beej's guides to Network Programming and Inter-Process Communication both have good information on how to use sockets, and even answer this exact question.






                share|improve this answer















                A socket is just a logical endpoint for communication. They exist on the transport layer. You can send and receive things on a socket, you can bind and listen to a socket. A socket is specific to a protocol, machine, and port, and is addressed as such in the header of a packet.



                Beej's guides to Network Programming and Inter-Process Communication both have good information on how to use sockets, and even answer this exact question.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 hours ago









                Jesuisme

                1033




                1033










                answered Jul 9 '11 at 1:08









                Shawn J. GoffShawn J. Goff

                29.6k19110134




                29.6k19110134

























                    60














                    In the simplest terms, a socket is a pseudo-file that represents a network connection. Once a socket has been created (using the proper primitives, and the proper parameters to identify the other host), writes to the socket are turned into network packets that get sent out, and data received from the network can be read from the socket.



                    In one regard, sockets are very similar to pipes: they look just like files to the programs using them, but do not result in read or writes to a disk; rather, they allow communicating with another program (local in the case of pipes, and possibly remote in the case of sockets). They also offer, as you mention, bidirectional communication (much like a pair of properly connected pipes could).



                    Finally, it is common for programs on a single machine to communicate using standard network protocols, such as TCP; it would be wasteful to go all the way to the network hardware (if any!), computing checksums, etc., just to go back to the same host: that's where Unix domains sockets come in. Those are much like regular sockets, except they connect processes on the same host rather than remote processes, and do not attempt to use any network resources at all. In this way, they are a medium of inter-process communication.



                    As tripleee mentioned, in the course of the history of BSD, pipes were introduced earlier than sockets, and were reimplemented using sockets once those existed. The same reference, The Design and Implementation of the FreeBSD Operating System, mentions that pipes were then reverted to a non-socket implementation for performance reasons: this certainly underlines the fact that pipes share similarities.






                    share|improve this answer





















                    • 2





                      Maybe also mention that pipes predate sockets, but once the socket interface was added to Unix, it made a lot of sense to reimplement pipes using local sockets.

                      – tripleee
                      Apr 1 '15 at 10:57











                    • @tripleee: That's a great historical point. Care to provide a reference?

                      – dhag
                      Apr 1 '15 at 14:00











                    • Quick googling turns up page 40 in The Design and Implementation of the FreeBSD Operating System; the text mentions this change in 4.2BSD but also clarifies that this is no longer how it's done, for performance reasons.

                      – tripleee
                      Apr 1 '15 at 14:12













                    • Excellent, I'll add this to my answer.

                      – dhag
                      Apr 1 '15 at 14:15











                    • The best techno answer in all

                      – chaosguru
                      Feb 14 '18 at 11:26
















                    60














                    In the simplest terms, a socket is a pseudo-file that represents a network connection. Once a socket has been created (using the proper primitives, and the proper parameters to identify the other host), writes to the socket are turned into network packets that get sent out, and data received from the network can be read from the socket.



                    In one regard, sockets are very similar to pipes: they look just like files to the programs using them, but do not result in read or writes to a disk; rather, they allow communicating with another program (local in the case of pipes, and possibly remote in the case of sockets). They also offer, as you mention, bidirectional communication (much like a pair of properly connected pipes could).



                    Finally, it is common for programs on a single machine to communicate using standard network protocols, such as TCP; it would be wasteful to go all the way to the network hardware (if any!), computing checksums, etc., just to go back to the same host: that's where Unix domains sockets come in. Those are much like regular sockets, except they connect processes on the same host rather than remote processes, and do not attempt to use any network resources at all. In this way, they are a medium of inter-process communication.



                    As tripleee mentioned, in the course of the history of BSD, pipes were introduced earlier than sockets, and were reimplemented using sockets once those existed. The same reference, The Design and Implementation of the FreeBSD Operating System, mentions that pipes were then reverted to a non-socket implementation for performance reasons: this certainly underlines the fact that pipes share similarities.






                    share|improve this answer





















                    • 2





                      Maybe also mention that pipes predate sockets, but once the socket interface was added to Unix, it made a lot of sense to reimplement pipes using local sockets.

                      – tripleee
                      Apr 1 '15 at 10:57











                    • @tripleee: That's a great historical point. Care to provide a reference?

                      – dhag
                      Apr 1 '15 at 14:00











                    • Quick googling turns up page 40 in The Design and Implementation of the FreeBSD Operating System; the text mentions this change in 4.2BSD but also clarifies that this is no longer how it's done, for performance reasons.

                      – tripleee
                      Apr 1 '15 at 14:12













                    • Excellent, I'll add this to my answer.

                      – dhag
                      Apr 1 '15 at 14:15











                    • The best techno answer in all

                      – chaosguru
                      Feb 14 '18 at 11:26














                    60












                    60








                    60







                    In the simplest terms, a socket is a pseudo-file that represents a network connection. Once a socket has been created (using the proper primitives, and the proper parameters to identify the other host), writes to the socket are turned into network packets that get sent out, and data received from the network can be read from the socket.



                    In one regard, sockets are very similar to pipes: they look just like files to the programs using them, but do not result in read or writes to a disk; rather, they allow communicating with another program (local in the case of pipes, and possibly remote in the case of sockets). They also offer, as you mention, bidirectional communication (much like a pair of properly connected pipes could).



                    Finally, it is common for programs on a single machine to communicate using standard network protocols, such as TCP; it would be wasteful to go all the way to the network hardware (if any!), computing checksums, etc., just to go back to the same host: that's where Unix domains sockets come in. Those are much like regular sockets, except they connect processes on the same host rather than remote processes, and do not attempt to use any network resources at all. In this way, they are a medium of inter-process communication.



                    As tripleee mentioned, in the course of the history of BSD, pipes were introduced earlier than sockets, and were reimplemented using sockets once those existed. The same reference, The Design and Implementation of the FreeBSD Operating System, mentions that pipes were then reverted to a non-socket implementation for performance reasons: this certainly underlines the fact that pipes share similarities.






                    share|improve this answer















                    In the simplest terms, a socket is a pseudo-file that represents a network connection. Once a socket has been created (using the proper primitives, and the proper parameters to identify the other host), writes to the socket are turned into network packets that get sent out, and data received from the network can be read from the socket.



                    In one regard, sockets are very similar to pipes: they look just like files to the programs using them, but do not result in read or writes to a disk; rather, they allow communicating with another program (local in the case of pipes, and possibly remote in the case of sockets). They also offer, as you mention, bidirectional communication (much like a pair of properly connected pipes could).



                    Finally, it is common for programs on a single machine to communicate using standard network protocols, such as TCP; it would be wasteful to go all the way to the network hardware (if any!), computing checksums, etc., just to go back to the same host: that's where Unix domains sockets come in. Those are much like regular sockets, except they connect processes on the same host rather than remote processes, and do not attempt to use any network resources at all. In this way, they are a medium of inter-process communication.



                    As tripleee mentioned, in the course of the history of BSD, pipes were introduced earlier than sockets, and were reimplemented using sockets once those existed. The same reference, The Design and Implementation of the FreeBSD Operating System, mentions that pipes were then reverted to a non-socket implementation for performance reasons: this certainly underlines the fact that pipes share similarities.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Apr 2 '15 at 21:49

























                    answered Mar 31 '15 at 21:12









                    dhagdhag

                    11.4k33145




                    11.4k33145








                    • 2





                      Maybe also mention that pipes predate sockets, but once the socket interface was added to Unix, it made a lot of sense to reimplement pipes using local sockets.

                      – tripleee
                      Apr 1 '15 at 10:57











                    • @tripleee: That's a great historical point. Care to provide a reference?

                      – dhag
                      Apr 1 '15 at 14:00











                    • Quick googling turns up page 40 in The Design and Implementation of the FreeBSD Operating System; the text mentions this change in 4.2BSD but also clarifies that this is no longer how it's done, for performance reasons.

                      – tripleee
                      Apr 1 '15 at 14:12













                    • Excellent, I'll add this to my answer.

                      – dhag
                      Apr 1 '15 at 14:15











                    • The best techno answer in all

                      – chaosguru
                      Feb 14 '18 at 11:26














                    • 2





                      Maybe also mention that pipes predate sockets, but once the socket interface was added to Unix, it made a lot of sense to reimplement pipes using local sockets.

                      – tripleee
                      Apr 1 '15 at 10:57











                    • @tripleee: That's a great historical point. Care to provide a reference?

                      – dhag
                      Apr 1 '15 at 14:00











                    • Quick googling turns up page 40 in The Design and Implementation of the FreeBSD Operating System; the text mentions this change in 4.2BSD but also clarifies that this is no longer how it's done, for performance reasons.

                      – tripleee
                      Apr 1 '15 at 14:12













                    • Excellent, I'll add this to my answer.

                      – dhag
                      Apr 1 '15 at 14:15











                    • The best techno answer in all

                      – chaosguru
                      Feb 14 '18 at 11:26








                    2




                    2





                    Maybe also mention that pipes predate sockets, but once the socket interface was added to Unix, it made a lot of sense to reimplement pipes using local sockets.

                    – tripleee
                    Apr 1 '15 at 10:57





                    Maybe also mention that pipes predate sockets, but once the socket interface was added to Unix, it made a lot of sense to reimplement pipes using local sockets.

                    – tripleee
                    Apr 1 '15 at 10:57













                    @tripleee: That's a great historical point. Care to provide a reference?

                    – dhag
                    Apr 1 '15 at 14:00





                    @tripleee: That's a great historical point. Care to provide a reference?

                    – dhag
                    Apr 1 '15 at 14:00













                    Quick googling turns up page 40 in The Design and Implementation of the FreeBSD Operating System; the text mentions this change in 4.2BSD but also clarifies that this is no longer how it's done, for performance reasons.

                    – tripleee
                    Apr 1 '15 at 14:12







                    Quick googling turns up page 40 in The Design and Implementation of the FreeBSD Operating System; the text mentions this change in 4.2BSD but also clarifies that this is no longer how it's done, for performance reasons.

                    – tripleee
                    Apr 1 '15 at 14:12















                    Excellent, I'll add this to my answer.

                    – dhag
                    Apr 1 '15 at 14:15





                    Excellent, I'll add this to my answer.

                    – dhag
                    Apr 1 '15 at 14:15













                    The best techno answer in all

                    – chaosguru
                    Feb 14 '18 at 11:26





                    The best techno answer in all

                    – chaosguru
                    Feb 14 '18 at 11:26











                    5














                    A socket an abstraction. It provides a interface for applications to utilize a system resource (in this case the network connection) in a way that allows the operating system to mediate and organize the use of a limited resource by any number of applications.



                    If the data being sent through the socket could be thought of as envelopes of mail, then the socket would be your mail box. You attach a mailbox(socket) to your house(program) and put your outgoing mail(data) into it. At a scheduled time the mailman (operating system) comes along and picks up your outgoing mail and drops off any incoming mail in the same mailbox. Your outgoing mail is conveyed on your behalf to the recipient through the mailman's truck(network connection) along with all your neighbors' mail. This allows you to correspond with people far away without the need for the expense, time, difficulty, etc. of delivering the letter yourself.



                    As for why they're called 'sockets' well, the notion that the inventors get to call it whatever they want probably plays a large role there. Though, it's not a bad name in my opinion :)






                    share|improve this answer




























                      5














                      A socket an abstraction. It provides a interface for applications to utilize a system resource (in this case the network connection) in a way that allows the operating system to mediate and organize the use of a limited resource by any number of applications.



                      If the data being sent through the socket could be thought of as envelopes of mail, then the socket would be your mail box. You attach a mailbox(socket) to your house(program) and put your outgoing mail(data) into it. At a scheduled time the mailman (operating system) comes along and picks up your outgoing mail and drops off any incoming mail in the same mailbox. Your outgoing mail is conveyed on your behalf to the recipient through the mailman's truck(network connection) along with all your neighbors' mail. This allows you to correspond with people far away without the need for the expense, time, difficulty, etc. of delivering the letter yourself.



                      As for why they're called 'sockets' well, the notion that the inventors get to call it whatever they want probably plays a large role there. Though, it's not a bad name in my opinion :)






                      share|improve this answer


























                        5












                        5








                        5







                        A socket an abstraction. It provides a interface for applications to utilize a system resource (in this case the network connection) in a way that allows the operating system to mediate and organize the use of a limited resource by any number of applications.



                        If the data being sent through the socket could be thought of as envelopes of mail, then the socket would be your mail box. You attach a mailbox(socket) to your house(program) and put your outgoing mail(data) into it. At a scheduled time the mailman (operating system) comes along and picks up your outgoing mail and drops off any incoming mail in the same mailbox. Your outgoing mail is conveyed on your behalf to the recipient through the mailman's truck(network connection) along with all your neighbors' mail. This allows you to correspond with people far away without the need for the expense, time, difficulty, etc. of delivering the letter yourself.



                        As for why they're called 'sockets' well, the notion that the inventors get to call it whatever they want probably plays a large role there. Though, it's not a bad name in my opinion :)






                        share|improve this answer













                        A socket an abstraction. It provides a interface for applications to utilize a system resource (in this case the network connection) in a way that allows the operating system to mediate and organize the use of a limited resource by any number of applications.



                        If the data being sent through the socket could be thought of as envelopes of mail, then the socket would be your mail box. You attach a mailbox(socket) to your house(program) and put your outgoing mail(data) into it. At a scheduled time the mailman (operating system) comes along and picks up your outgoing mail and drops off any incoming mail in the same mailbox. Your outgoing mail is conveyed on your behalf to the recipient through the mailman's truck(network connection) along with all your neighbors' mail. This allows you to correspond with people far away without the need for the expense, time, difficulty, etc. of delivering the letter yourself.



                        As for why they're called 'sockets' well, the notion that the inventors get to call it whatever they want probably plays a large role there. Though, it's not a bad name in my opinion :)







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jul 9 '11 at 10:00









                        Andrew LambertAndrew Lambert

                        1,80511116




                        1,80511116























                            4














                            Now, what is it?



                            A socket, or "socket" can be several things:



                            First of all, it is a thought model and an application programming interface (API). That means you have a set of rules you need to follow and a set of functions that you can use to write programs that do something, according to a precisely specified contract. In this particular case, something means exchange data with another program.



                            The sockets API widely abstracts the details of "communication" in general. It encapsulates who you talk with and how, all through one (almost) consistent and identical cookie-cutter form.

                            You can create sockets in different "domains" (such as e.g. a "unix socket" or a "internet socket") and of different types of communication (e.g. a "datagram" socket or a "stream" socket) and talk to different recipients, and everything works exactly the same (well, 99%, there are obviously minute differences that you'll have to account for).



                            You do not need to know (and you do not even want to know!) whether you talk to another program on the same computer or on a different computer, or whether there is IPv4 or IPv6 network in between those computers, or maybe some other protocol that you have never heard of.



                            socket is also the name of the library function (or syscall) which creates "the socket", which is a special kind of file (everything in Unix is a file).



                            How does it compare to...




                            sockets fall into the same category as pipes and name pipes




                            A pipe is a means of one way communication between a reader and a writer (both being programs) on the same computer. It simulates a stream of data (just like e.g. TCP).

                            That is, no individual "messages" or "blocks of data" exist from the pipe's point of view. You can copy any amount of data into "one end", and someone else can read any amount of data (not necessarily the same, and not necessarily in one go) at the "other end" in the same byte order as you've pushed it in.



                            A named pipe is, well, simply a pipe which owns a name in the filesystem. That is, it's something that looks and behaves just like a file, it appears in the directory listing and you can open it, write to it, etc etc. Note that you can also create socket special files (that would be a named socket).



                            A socket, on the other hand, is a means of two way ("duplex") communication, that means you can write to and read from the same socket, and you do not need two separate sockets for a two-way communication.

                            Also, a socket can act as a stream (identical to a pipe), or it can send discrete, unreliable messages, or it can send discrete, ordered messages (the first two work on any domain, the last only on "unix domain"). It can send messages (or simulate a stream) to someone on an entirely different computer. A socket can even do a form of one-to-many communication (multicast) under some conditions.



                            With that in mind, it is clear that sockets do something much more complicated and generally have more overhead than pipes (which are basically no more than a simple memcpy to and from a buffer!), but if you create local sockets (i.e. on the same computer), the operating system usually applies a heavily optimized fast path, so there is really not much of a difference.




                            inter-process communication
                            sometimes mentioned with regard to networks




                            Yes, sockets are one possible way of inter-process communication (shared memory and pipes being examples of alternatives). All at the same time, they are being used for "networking", as explained above.






                            share|improve this answer




























                              4














                              Now, what is it?



                              A socket, or "socket" can be several things:



                              First of all, it is a thought model and an application programming interface (API). That means you have a set of rules you need to follow and a set of functions that you can use to write programs that do something, according to a precisely specified contract. In this particular case, something means exchange data with another program.



                              The sockets API widely abstracts the details of "communication" in general. It encapsulates who you talk with and how, all through one (almost) consistent and identical cookie-cutter form.

                              You can create sockets in different "domains" (such as e.g. a "unix socket" or a "internet socket") and of different types of communication (e.g. a "datagram" socket or a "stream" socket) and talk to different recipients, and everything works exactly the same (well, 99%, there are obviously minute differences that you'll have to account for).



                              You do not need to know (and you do not even want to know!) whether you talk to another program on the same computer or on a different computer, or whether there is IPv4 or IPv6 network in between those computers, or maybe some other protocol that you have never heard of.



                              socket is also the name of the library function (or syscall) which creates "the socket", which is a special kind of file (everything in Unix is a file).



                              How does it compare to...




                              sockets fall into the same category as pipes and name pipes




                              A pipe is a means of one way communication between a reader and a writer (both being programs) on the same computer. It simulates a stream of data (just like e.g. TCP).

                              That is, no individual "messages" or "blocks of data" exist from the pipe's point of view. You can copy any amount of data into "one end", and someone else can read any amount of data (not necessarily the same, and not necessarily in one go) at the "other end" in the same byte order as you've pushed it in.



                              A named pipe is, well, simply a pipe which owns a name in the filesystem. That is, it's something that looks and behaves just like a file, it appears in the directory listing and you can open it, write to it, etc etc. Note that you can also create socket special files (that would be a named socket).



                              A socket, on the other hand, is a means of two way ("duplex") communication, that means you can write to and read from the same socket, and you do not need two separate sockets for a two-way communication.

                              Also, a socket can act as a stream (identical to a pipe), or it can send discrete, unreliable messages, or it can send discrete, ordered messages (the first two work on any domain, the last only on "unix domain"). It can send messages (or simulate a stream) to someone on an entirely different computer. A socket can even do a form of one-to-many communication (multicast) under some conditions.



                              With that in mind, it is clear that sockets do something much more complicated and generally have more overhead than pipes (which are basically no more than a simple memcpy to and from a buffer!), but if you create local sockets (i.e. on the same computer), the operating system usually applies a heavily optimized fast path, so there is really not much of a difference.




                              inter-process communication
                              sometimes mentioned with regard to networks




                              Yes, sockets are one possible way of inter-process communication (shared memory and pipes being examples of alternatives). All at the same time, they are being used for "networking", as explained above.






                              share|improve this answer


























                                4












                                4








                                4







                                Now, what is it?



                                A socket, or "socket" can be several things:



                                First of all, it is a thought model and an application programming interface (API). That means you have a set of rules you need to follow and a set of functions that you can use to write programs that do something, according to a precisely specified contract. In this particular case, something means exchange data with another program.



                                The sockets API widely abstracts the details of "communication" in general. It encapsulates who you talk with and how, all through one (almost) consistent and identical cookie-cutter form.

                                You can create sockets in different "domains" (such as e.g. a "unix socket" or a "internet socket") and of different types of communication (e.g. a "datagram" socket or a "stream" socket) and talk to different recipients, and everything works exactly the same (well, 99%, there are obviously minute differences that you'll have to account for).



                                You do not need to know (and you do not even want to know!) whether you talk to another program on the same computer or on a different computer, or whether there is IPv4 or IPv6 network in between those computers, or maybe some other protocol that you have never heard of.



                                socket is also the name of the library function (or syscall) which creates "the socket", which is a special kind of file (everything in Unix is a file).



                                How does it compare to...




                                sockets fall into the same category as pipes and name pipes




                                A pipe is a means of one way communication between a reader and a writer (both being programs) on the same computer. It simulates a stream of data (just like e.g. TCP).

                                That is, no individual "messages" or "blocks of data" exist from the pipe's point of view. You can copy any amount of data into "one end", and someone else can read any amount of data (not necessarily the same, and not necessarily in one go) at the "other end" in the same byte order as you've pushed it in.



                                A named pipe is, well, simply a pipe which owns a name in the filesystem. That is, it's something that looks and behaves just like a file, it appears in the directory listing and you can open it, write to it, etc etc. Note that you can also create socket special files (that would be a named socket).



                                A socket, on the other hand, is a means of two way ("duplex") communication, that means you can write to and read from the same socket, and you do not need two separate sockets for a two-way communication.

                                Also, a socket can act as a stream (identical to a pipe), or it can send discrete, unreliable messages, or it can send discrete, ordered messages (the first two work on any domain, the last only on "unix domain"). It can send messages (or simulate a stream) to someone on an entirely different computer. A socket can even do a form of one-to-many communication (multicast) under some conditions.



                                With that in mind, it is clear that sockets do something much more complicated and generally have more overhead than pipes (which are basically no more than a simple memcpy to and from a buffer!), but if you create local sockets (i.e. on the same computer), the operating system usually applies a heavily optimized fast path, so there is really not much of a difference.




                                inter-process communication
                                sometimes mentioned with regard to networks




                                Yes, sockets are one possible way of inter-process communication (shared memory and pipes being examples of alternatives). All at the same time, they are being used for "networking", as explained above.






                                share|improve this answer













                                Now, what is it?



                                A socket, or "socket" can be several things:



                                First of all, it is a thought model and an application programming interface (API). That means you have a set of rules you need to follow and a set of functions that you can use to write programs that do something, according to a precisely specified contract. In this particular case, something means exchange data with another program.



                                The sockets API widely abstracts the details of "communication" in general. It encapsulates who you talk with and how, all through one (almost) consistent and identical cookie-cutter form.

                                You can create sockets in different "domains" (such as e.g. a "unix socket" or a "internet socket") and of different types of communication (e.g. a "datagram" socket or a "stream" socket) and talk to different recipients, and everything works exactly the same (well, 99%, there are obviously minute differences that you'll have to account for).



                                You do not need to know (and you do not even want to know!) whether you talk to another program on the same computer or on a different computer, or whether there is IPv4 or IPv6 network in between those computers, or maybe some other protocol that you have never heard of.



                                socket is also the name of the library function (or syscall) which creates "the socket", which is a special kind of file (everything in Unix is a file).



                                How does it compare to...




                                sockets fall into the same category as pipes and name pipes




                                A pipe is a means of one way communication between a reader and a writer (both being programs) on the same computer. It simulates a stream of data (just like e.g. TCP).

                                That is, no individual "messages" or "blocks of data" exist from the pipe's point of view. You can copy any amount of data into "one end", and someone else can read any amount of data (not necessarily the same, and not necessarily in one go) at the "other end" in the same byte order as you've pushed it in.



                                A named pipe is, well, simply a pipe which owns a name in the filesystem. That is, it's something that looks and behaves just like a file, it appears in the directory listing and you can open it, write to it, etc etc. Note that you can also create socket special files (that would be a named socket).



                                A socket, on the other hand, is a means of two way ("duplex") communication, that means you can write to and read from the same socket, and you do not need two separate sockets for a two-way communication.

                                Also, a socket can act as a stream (identical to a pipe), or it can send discrete, unreliable messages, or it can send discrete, ordered messages (the first two work on any domain, the last only on "unix domain"). It can send messages (or simulate a stream) to someone on an entirely different computer. A socket can even do a form of one-to-many communication (multicast) under some conditions.



                                With that in mind, it is clear that sockets do something much more complicated and generally have more overhead than pipes (which are basically no more than a simple memcpy to and from a buffer!), but if you create local sockets (i.e. on the same computer), the operating system usually applies a heavily optimized fast path, so there is really not much of a difference.




                                inter-process communication
                                sometimes mentioned with regard to networks




                                Yes, sockets are one possible way of inter-process communication (shared memory and pipes being examples of alternatives). All at the same time, they are being used for "networking", as explained above.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Apr 1 '15 at 13:24









                                DamonDamon

                                1,44479




                                1,44479























                                    1














                                    For udp or tcp over IP,



                                    A socket address is the combination of an IP address and a port number.



                                    An IP address is the address of a machine on the internet e.g. unix.stackexchange.com has address 198.252.206.140



                                    However each machine must be able to provide more than one service, so most machines will provide http (web pages) on port 80, and ssh on port 22, and etc.



                                    So unix.stackexchange.com:80 port 80 of unix.stackexchange.com (a socket) is the access point of this web site.



                                    However there are other types of socket, see comments below.






                                    share|improve this answer





















                                    • 5





                                      tcp/ip is only one kind of socket. There are others that have nothing to do with tcp/ip.

                                      – psusi
                                      Mar 31 '15 at 23:31











                                    • how many different kinds of sockets are there ?

                                      – Abdul Al Hazred
                                      Mar 31 '15 at 23:35






                                    • 1





                                      @AbdulAlHazred, I know of four common types used with ip networking, the same with ip6, two with unix, and two with IPX. I have not looked at ax25, atm, or appletalk. There are other protocols supported on linux, and there are protocols linux does not support. In most cases each protocol has stream(tcp) and datagram(udp) sockets. Raw sockets are also common, and imcp may also have a socket interface.

                                      – hildred
                                      Apr 1 '15 at 1:41











                                    • The point being, this answer is incomplete in that it only covers one type of socket, and misleading in that it represent sockets in general as if they were always network sockets, and specifically IP (AF_INET) sockets.

                                      – tripleee
                                      Apr 1 '15 at 10:55
















                                    1














                                    For udp or tcp over IP,



                                    A socket address is the combination of an IP address and a port number.



                                    An IP address is the address of a machine on the internet e.g. unix.stackexchange.com has address 198.252.206.140



                                    However each machine must be able to provide more than one service, so most machines will provide http (web pages) on port 80, and ssh on port 22, and etc.



                                    So unix.stackexchange.com:80 port 80 of unix.stackexchange.com (a socket) is the access point of this web site.



                                    However there are other types of socket, see comments below.






                                    share|improve this answer





















                                    • 5





                                      tcp/ip is only one kind of socket. There are others that have nothing to do with tcp/ip.

                                      – psusi
                                      Mar 31 '15 at 23:31











                                    • how many different kinds of sockets are there ?

                                      – Abdul Al Hazred
                                      Mar 31 '15 at 23:35






                                    • 1





                                      @AbdulAlHazred, I know of four common types used with ip networking, the same with ip6, two with unix, and two with IPX. I have not looked at ax25, atm, or appletalk. There are other protocols supported on linux, and there are protocols linux does not support. In most cases each protocol has stream(tcp) and datagram(udp) sockets. Raw sockets are also common, and imcp may also have a socket interface.

                                      – hildred
                                      Apr 1 '15 at 1:41











                                    • The point being, this answer is incomplete in that it only covers one type of socket, and misleading in that it represent sockets in general as if they were always network sockets, and specifically IP (AF_INET) sockets.

                                      – tripleee
                                      Apr 1 '15 at 10:55














                                    1












                                    1








                                    1







                                    For udp or tcp over IP,



                                    A socket address is the combination of an IP address and a port number.



                                    An IP address is the address of a machine on the internet e.g. unix.stackexchange.com has address 198.252.206.140



                                    However each machine must be able to provide more than one service, so most machines will provide http (web pages) on port 80, and ssh on port 22, and etc.



                                    So unix.stackexchange.com:80 port 80 of unix.stackexchange.com (a socket) is the access point of this web site.



                                    However there are other types of socket, see comments below.






                                    share|improve this answer















                                    For udp or tcp over IP,



                                    A socket address is the combination of an IP address and a port number.



                                    An IP address is the address of a machine on the internet e.g. unix.stackexchange.com has address 198.252.206.140



                                    However each machine must be able to provide more than one service, so most machines will provide http (web pages) on port 80, and ssh on port 22, and etc.



                                    So unix.stackexchange.com:80 port 80 of unix.stackexchange.com (a socket) is the access point of this web site.



                                    However there are other types of socket, see comments below.







                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited Apr 3 '15 at 21:28

























                                    answered Mar 31 '15 at 23:11









                                    ctrl-alt-delorctrl-alt-delor

                                    11.2k42058




                                    11.2k42058








                                    • 5





                                      tcp/ip is only one kind of socket. There are others that have nothing to do with tcp/ip.

                                      – psusi
                                      Mar 31 '15 at 23:31











                                    • how many different kinds of sockets are there ?

                                      – Abdul Al Hazred
                                      Mar 31 '15 at 23:35






                                    • 1





                                      @AbdulAlHazred, I know of four common types used with ip networking, the same with ip6, two with unix, and two with IPX. I have not looked at ax25, atm, or appletalk. There are other protocols supported on linux, and there are protocols linux does not support. In most cases each protocol has stream(tcp) and datagram(udp) sockets. Raw sockets are also common, and imcp may also have a socket interface.

                                      – hildred
                                      Apr 1 '15 at 1:41











                                    • The point being, this answer is incomplete in that it only covers one type of socket, and misleading in that it represent sockets in general as if they were always network sockets, and specifically IP (AF_INET) sockets.

                                      – tripleee
                                      Apr 1 '15 at 10:55














                                    • 5





                                      tcp/ip is only one kind of socket. There are others that have nothing to do with tcp/ip.

                                      – psusi
                                      Mar 31 '15 at 23:31











                                    • how many different kinds of sockets are there ?

                                      – Abdul Al Hazred
                                      Mar 31 '15 at 23:35






                                    • 1





                                      @AbdulAlHazred, I know of four common types used with ip networking, the same with ip6, two with unix, and two with IPX. I have not looked at ax25, atm, or appletalk. There are other protocols supported on linux, and there are protocols linux does not support. In most cases each protocol has stream(tcp) and datagram(udp) sockets. Raw sockets are also common, and imcp may also have a socket interface.

                                      – hildred
                                      Apr 1 '15 at 1:41











                                    • The point being, this answer is incomplete in that it only covers one type of socket, and misleading in that it represent sockets in general as if they were always network sockets, and specifically IP (AF_INET) sockets.

                                      – tripleee
                                      Apr 1 '15 at 10:55








                                    5




                                    5





                                    tcp/ip is only one kind of socket. There are others that have nothing to do with tcp/ip.

                                    – psusi
                                    Mar 31 '15 at 23:31





                                    tcp/ip is only one kind of socket. There are others that have nothing to do with tcp/ip.

                                    – psusi
                                    Mar 31 '15 at 23:31













                                    how many different kinds of sockets are there ?

                                    – Abdul Al Hazred
                                    Mar 31 '15 at 23:35





                                    how many different kinds of sockets are there ?

                                    – Abdul Al Hazred
                                    Mar 31 '15 at 23:35




                                    1




                                    1





                                    @AbdulAlHazred, I know of four common types used with ip networking, the same with ip6, two with unix, and two with IPX. I have not looked at ax25, atm, or appletalk. There are other protocols supported on linux, and there are protocols linux does not support. In most cases each protocol has stream(tcp) and datagram(udp) sockets. Raw sockets are also common, and imcp may also have a socket interface.

                                    – hildred
                                    Apr 1 '15 at 1:41





                                    @AbdulAlHazred, I know of four common types used with ip networking, the same with ip6, two with unix, and two with IPX. I have not looked at ax25, atm, or appletalk. There are other protocols supported on linux, and there are protocols linux does not support. In most cases each protocol has stream(tcp) and datagram(udp) sockets. Raw sockets are also common, and imcp may also have a socket interface.

                                    – hildred
                                    Apr 1 '15 at 1:41













                                    The point being, this answer is incomplete in that it only covers one type of socket, and misleading in that it represent sockets in general as if they were always network sockets, and specifically IP (AF_INET) sockets.

                                    – tripleee
                                    Apr 1 '15 at 10:55





                                    The point being, this answer is incomplete in that it only covers one type of socket, and misleading in that it represent sockets in general as if they were always network sockets, and specifically IP (AF_INET) sockets.

                                    – tripleee
                                    Apr 1 '15 at 10:55











                                    0














                                    I believe you asked about networking. So TCP services use sockets as point for communication and are made up of an IP address, protocol and port number.






                                    share|improve this answer




























                                      0














                                      I believe you asked about networking. So TCP services use sockets as point for communication and are made up of an IP address, protocol and port number.






                                      share|improve this answer


























                                        0












                                        0








                                        0







                                        I believe you asked about networking. So TCP services use sockets as point for communication and are made up of an IP address, protocol and port number.






                                        share|improve this answer













                                        I believe you asked about networking. So TCP services use sockets as point for communication and are made up of an IP address, protocol and port number.







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Mar 17 '16 at 8:43









                                        Dragos AlexeDragos Alexe

                                        11615




                                        11615























                                            -1














                                            That's a great question, Think about it for a second... what is a socket ?



                                            A socket can be compared to a wall outlet/receptacle



                                            A socket can have a LISTEN state or an ESTABLISHED state



                                            A socket is a window between your server/operating system that serves you and the inter net



                                            A socket allows the user to connect to the outside world, "via cyber space"



                                            A socket is exactly as it sounds as an outlet in your home and in network, It allows a user or home owner to sock it in for access to more.






                                            share|improve this answer




























                                              -1














                                              That's a great question, Think about it for a second... what is a socket ?



                                              A socket can be compared to a wall outlet/receptacle



                                              A socket can have a LISTEN state or an ESTABLISHED state



                                              A socket is a window between your server/operating system that serves you and the inter net



                                              A socket allows the user to connect to the outside world, "via cyber space"



                                              A socket is exactly as it sounds as an outlet in your home and in network, It allows a user or home owner to sock it in for access to more.






                                              share|improve this answer


























                                                -1












                                                -1








                                                -1







                                                That's a great question, Think about it for a second... what is a socket ?



                                                A socket can be compared to a wall outlet/receptacle



                                                A socket can have a LISTEN state or an ESTABLISHED state



                                                A socket is a window between your server/operating system that serves you and the inter net



                                                A socket allows the user to connect to the outside world, "via cyber space"



                                                A socket is exactly as it sounds as an outlet in your home and in network, It allows a user or home owner to sock it in for access to more.






                                                share|improve this answer













                                                That's a great question, Think about it for a second... what is a socket ?



                                                A socket can be compared to a wall outlet/receptacle



                                                A socket can have a LISTEN state or an ESTABLISHED state



                                                A socket is a window between your server/operating system that serves you and the inter net



                                                A socket allows the user to connect to the outside world, "via cyber space"



                                                A socket is exactly as it sounds as an outlet in your home and in network, It allows a user or home owner to sock it in for access to more.







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered May 7 '18 at 17:59









                                                hello motohello moto

                                                14111




                                                14111






























                                                    draft saved

                                                    draft discarded




















































                                                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid



                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                    To learn more, see our tips on writing great answers.




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function () {
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f16311%2fwhat-is-a-socket%23new-answer', 'question_page');
                                                    }
                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown







                                                    Popular posts from this blog

                                                    Entries order in /etc/network/interfaces

                                                    新発田市

                                                    Grub takes very long (several minutes) to open Menu (in Multi-Boot-System)