In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the s-type file in linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the s-type file in linux"?
In linux, s-type file refers to "socket file (socket)", which is a special file used for communication between processes; you can initialize a network protocol through this file, and then use a series of functions to initialize, transfer, and so on.
The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
Linux file type (b, c, d, l, s, -)
File type description b block devices are interface devices that provide system access to data, such as hard drives. C character device is the interface device of some serial ports, such as keyboard, mouse, printer, tty terminal. D directory, a folder similar to Windows. L
Linked files, similar to Windows shortcuts.
S socket file (socket) for communication between processes. -File, divided into plain text file (ASCII) and binary file (binary).
As a special file, socket socket can initialize a network protocol through this socket, and then initialize, transfer and so on this network protocol through a series of functions (write/read/accept).
Socket definition
Socket is the middle software abstraction layer for the communication between the application layer and the TCP/IP protocol family, and it is a group of interfaces. In the design pattern, Socket is actually a facade pattern, which hides the complex TCP/IP protocol family behind the Socket interface. For users, a simple set of interfaces is all, allowing Socket to organize the data to comply with the specified protocol.
The structure of socket in Linux Kernel
Socket is actually a structure in the kernel. This structure contains members such as ip, port, state, size, and so on, which are used to initialize socket details, but we cannot use these members directly. So Linux provides corresponding interface functions for me to call, and we use these functions to initialize the members of the socket structure.
In the structure
Ip, port: initialize IP address and port number
State: status of current network service (snooping / non-snooping)
Size: maximum number of connections
Because it is impossible for us to manipulate these structure members directly, Linux provides corresponding interface functions for us to call to manipulate these members.
Bind (): bind ip to port number
Listen (): monitoring
.... Wait, there are a lot of other functions.
At this point, I believe you have a deeper understanding of "what the s-type file in linux refers to". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.