Friday, 5 January 2018

What is a socket

What is a socket ?

  1. Sockets allow communication between two different processes on the same or different machines.
  2. It’s talk to other computers using standard Unix file descriptors.
  3. A file descriptor is just an integer associated with an open file and it can be a network connection, a text file, a terminal, or something else.
  4. Used in a client-server application framework.
  5. Most of the application-level protocols like FTP, SMTP, and POP3 make use of sockets to establish connection between client and server and then for exchanging data.


Socket Types:

  1. SOCK_STREAM - Provides sequenced, reliable, two-way, connection-based byte streams.
  2. SOCK_DGRAM   - Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
  3. SOCK_RAW        -  Provides raw network protocol access. These provide users access to the underlying communication protocols, which support socket abstractions
  4. SOCK_SEQPACKET  -

No comments:

Post a Comment