Reprint: Android Summary series: Android broadcast mechanism1.Android Broadcast Mechanism overviewAndroid broadcasts are divided into two areas: the broadcast sender and the broadcast receiver, usually broadcastreceiver refers to the broadcast recipient (broadcast receiver). Broadcast as a means of communication between Android components, you can use the following scenarios:1. Message communication within
This article is mainly from two aspects:Contents of this issue1 exactly Once2 output is not duplicated1 exactly OnceTransaction: Bank Transfer For example, a user to transfer to the User B, if the B users confiscated, or received multiple accounts, is to undermine the consistency of the transaction. Transactions are handled and processed only once, that is, a is only turned once and B is only received once. Decrypt the sparkstreaming schema from a transactional perspective: The sparkstreaming
customer once (if the transfer of 10,000 yuan), normally a client's account will only be deducted once and the amount is 10,000 yuan, B client's account will only receive a customer's transfer of money and the amount is also 10,000 yuan, this is the specific embodiment of business and its consistency, This means that the data will be processed and processed correctly once.However, the transaction processing of spark streaming differs from the transaction in the above case and its consistency; t
buffer to the receiver buffer, at least two copies of the process. Shared memory, although not copied, is complex and difficult to use.Table 1 Number of data copies in various IPC ways
Ipc
Number of copies of data
Shared memory
0
Binder
1
socket/Pipeline/Message Queuing
2
Another point is for security reasons. End users do not want to download the program from
communication model: a two-way transmission channel is established between sending SMTP and receiving SMTP for users' mail requests. The receiving SMTP can be the final receiver or intermediate transmitter. The SMTP command is sent by the sending SMTP and received by the receiving SMTP, while the response is sent by the opposite side.
Once the transfer channel is established, the SMTP sender sends the MAIL command to specify the mail sender. If the S
Currently, TCP/IP communication protocol and its standard socket application programming interface (API) are widely used in network transmission applications ). The TCP/IP transport layer has two parallel protocols: TCP and UDP. TCP (Transport Control Protocol) is connection-oriented and provides high-reliability services. User Data Protocol (UDP) is connectionless and provides efficient services. In practical engineering applications, the selection of reliability and efficiency depends on the a
calculate. The formula is as follows: (where the Devrtt is the meaning of deviation RTT)SRTT= Srtt+ α(rtt–s RTT)devrtt= (1-β) *devrtt+β* (| Rtt-srtt |) Rto=µ*srtt +∂*devrtt(among them: under Linux, α= 0.125,β= 0.25,μ= 1,∂= 4--This is the algorithm "good tuning parameters", nobody knows why, it just Works ... The final algorithm is used in today's TCP protocol (the source code for Linux in: Tcp_rtt_estimator).TCP Sliding windowTo illustrate, if you do not understand the TCP sliding window, you
,Receiver会将数据在内存中积累到一定程度的时候才会写入到WAL或者说写入到磁盘中。但是如果还没有积累到一定程度,Receiver崩溃了咋办?5. InputDStream的真正产生是在:Driver端产生的。Receiver不断的接收数据,Receiver为了保证安全性,他会不断的通过容错的方式进行处理(把数据写进磁盘,写进内存同时有副本的方式,或者说WAL),StreamingContext: First get data, second generation job.6. 假设数据崩溃的话,如何处理?A) driver-side data recovery: Directly driver checkpoint fi
each time, and waits for the receiver's acknowledgement signal;3> the sender receives an ACK signal from the receiving party, explaining that the packet is properly received and has the meaning of sending the next packet;4> the sender receives a NAK signal from the receiving party and interprets the request to resend the same packet;The 5> sender receives the CAN signal from the receiving party and interprets it as a request to stop the transmission unconditionally;6> the sender to complete the
+∂*devrtt(among them: under Linux, α= 0.125,β= 0.25,μ= 1,∂= 4--This is the algorithm "good tuning parameters", nobody knows why, it just Works ... The final algorithm is used in today's TCP protocol (the source code for Linux in: Tcp_rtt_estimator).TCP Sliding windowTo illustrate, if you do not understand the TCP sliding window, you are not aware of the TCP protocol. As we all know,TCP must solve the problem of reliable transmission and packet Chaos , so TCP must know the actual network data pr
protocol identifies the application process on the source and target side by using "port". The port number can use any number from 0 to 65535. When a service request is received, the operating system dynamically assigns a port number to the client's application. On the server side, each service serves the user on a "well known port" (Well-know).Serial Number field: 32 bits. Used to identify a stream of data bytes sent from the TCP source to the TCP destination, which represents the first data b
+∂*devrtt(among them: under Linux, α= 0.125,β= 0.25,μ= 1,∂= 4--This is the algorithm "good tuning parameters", nobody knows why, it just Works ... The final algorithm is used in today's TCP protocol (the source code for Linux in: Tcp_rtt_estimator).TCP Sliding windowTo illustrate, if you do not understand the TCP sliding window, you are not aware of the TCP protocol. As we all know,TCP must solve the problem of reliable transmission and packet Chaos , so TCP must know the actual network data pr
Encapsulates a request as an object, allowing you to parameterize the customer with different requests, queue requests or log requests, and support actions that can be undone
Structure diagram of the command pattern
The composition of the command pattern
As you can see from the structure diagram of the command pattern, it involves five roles, namely:(1), Customer role (client): Creates a specific command object and sets the recipient of the Command object.
Solve the problem of "sticking packets" for TCP network transmission
Author: Yang Xiaoping Wang shengkai
Source: http://www.ciw.com.cn/
Currently, TCP/IP communication protocol and its standard socket application programming interface (API) are widely used in network transmission applications ). The TCP/IP transport layer has two parallel protocols: TCP and UDP. TCP (transport control protocol) is connection-oriented and provides high-reliability services. User Data protocol (UDP) is connectionl
, then load the system, and then start the computer properly. But who will complete these processes? How to complete?We cannot allow customers who use computers to do this work. The main board is the main board. How can customers contact the main board? In reality, the button is connected to the motherboard using a connection line, so when the customer presses the button, it is equivalent to sending a command to the motherboard, let the motherboard to complete the subsequent work.In addition, fr
was executed.The command allows the requesting party and the party receiving the request to evolve independently, with the following advantages:(1) The command mode makes it easy to add new commands to the system.(2) Allow the party receiving the request to decide whether to veto the request.(3) It is easier to design a command queue.(4) The revocation and recovery of the request can be easily achieved.(5) If required, it is easier to log commands into the logs.The following is a schematic syst
SYNTAX (SYNTAX ):
Android: exported = ["true" | "false"]Android: icon = "drawable resource"Android: label = "string resource"Android: name = "string"Android: permission = "string"Android: process = "string">...
Included IN (contained in ):
Can contain ):
DESCRIPTION ):
This element is used to declare a broadcast receiver (A BroadcastReceiver subclass) as one of the application components. Broadcast receivers allow applications to receive broadcast
Overview of broadcastreceiver:
Broadcastreceiver is the base class that receives intent from sendbroadcast. You can use the context. registerreceiver () method to dynamically register a broadcastreceiver instance in the Code, or use the
Note: If you are a handler registered in the activity. onresume () method, you must deregister it in the activity. onpause () method. (When an activity is paused, it does not receive intents, and this can also reduce unnecessary overhead ). Do not log off the ha
Syntax (syntax ):
| "False"]Android: exported = ["true"| "False"]Android: icon ="DrawableResource"Android: Label ="StringResource"Android: Name ="String"Android: Permission ="String"Android: Process ="String">...
Included in (contained in ):
Can contain ):
Description ):
This element is used to declare a broadcast receiver (A broadcastreceiver subclass) as one of the application components. Broadcast receivers allow applications to receive broadcas
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.