What is a socket ?
- Sockets allow communication between two different processes on the same or different machines.
- It’s talk to other computers using standard Unix file descriptors.
- 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.
- Used in a client-server application framework.
- 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:
- SOCK_STREAM - Provides sequenced, reliable, two-way, connection-based byte streams.
- SOCK_DGRAM - Supports datagrams (connectionless, unreliable messages of a fixed maximum length).
- SOCK_RAW - Provides raw network protocol access. These provide users access to the underlying communication protocols, which support socket abstractions
- SOCK_SEQPACKET -
No comments:
Post a Comment