Differences between socket byte stream and response stream

Source: Internet
Author: User

byte stream is a binary stream processing character set.
the byte stream is the smallest unit in the stream.
, -128 to 127 of the information contained in a byte. that's all.
A dense stream is the smallest unit in a stream. A char represents a symbol, such as a number, literal, or punctuation. To represent a symbol, you must know the encoding method of the symbol. Such as ASCII, UTF-8, and gb2312. These encoding methods are used to encode the symbols and then store them in the char variable.
In other words, when we look at a byte stream, we only focus on the size of each byte. But when we focus on the attention stream, we need to see from the size of the character, the encoding format, to see what symbol this character represents.

What are stream, traffic, and word throttling?
 
A stream is a continuous byte queue.
 
Stream isProgramA continuous byte sequence of input or output. The input and output of devices (such as the mouse, keyboard, disk, screen, and printer) are processed by streams. In C, all streams are in the form of files-not necessarily physical disk files, but also logical files corresponding to an input/output source.
 
A stream is an I/O mechanism and function in an I/O system, or a streams subsystem. It is not a physical device.
Purpose of introducing a stream:
The traditional character device driver framework has many disadvantages, as shown in:
. The abstraction layer between the kernel and the character device driver is too high.
. The kernel does not provide reliable buffer allocation and management functions for character devices.
. Many systems regard data as a FIFO (first-in-first-out) byte stream on the character device interface, so they do not recognize message boundaries and distinguish between common devices and control information, and the ability to determine different message priorities, and there is no byte stream Traffic Control
. These problems are even more prominent in network data transmission devices. Data transmission in the network is based on messages or data groups.
Concept of stream:
In terms of communication, a stream is a full-duplex processing process. It is a data transmission channel between drivers and user processes in the kernel.
In terms of Stream construction, it consists of a stream header, the end of a stream driver, and zero or several optional modules. A stream header is a user-level interface that allows user applications to access a stream through the system call interface. The driver end communicates with the underlying device. The module in the middle of the stream processes data.

Reprinted from: http://fuzhong1983.blog.163.com/blog/static/168470520081111113125717/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.