First, Ddpush Push:
1. principle:
See http://yt0116.blog.51cto.com/9221014/1688096
2. features :
(1) only push can be achieved, if you want to push multiple people, you use the loop to control
(2) simple push, but you can customize the push format and content, there are general push, category push, custom push three formats, more flexible.
(3) Ddpush is based on the principle of socket programming, which is controlled using the UDP protocol. Server-side listens for client information and communicates.
3. Configuration: See Ddpush official website
4. Questions:
uuid correspond to the client?
when the server receives a client connection. Creates a virtual object for the client. Saved to a collection. This object holds the UUID of this object (usually MD5 encrypted string) the client's network address, the last heartbeat time, whether there is a message that needs to be pushed to the client, and so on some properties. so you can base uuid to send to corresponding customer information 。
(2) How does the Ddpush server know who to send messages to?
sending a push task to the Ddpush server is the Pusher.java class in Org.ddpush.im.v1.client.appserver. There are several ways to push 0x10 message push 0x11 message push 0x20 message that is to say we need to use Pusher.java to tell the Ddpush server I'm going to push a 0x10 to 100001 this user and then ddpush the server to accept the task. The user is found from the client virtual client object collection. If this user is not found. Create a dummy user object based on this push message and put it into the virtual client object collection when the user logs on to the Ddpush server, Ddpush discovers that the server already exists. The user is removed from the virtual client object collection. Then modify the properties of this client object. It is also found that there is a message in the virtual client object that needs to be pushed. The message was immediately pushed to the newly launched client.
(3) What is the difference between a UDP port and a server port?
UDP port: 9966
after the Ddpush server listens on port 9966. The client connects to this port of the server with the corresponding TCP or UDP. When the server receives a client connection. Creates a virtual object for the client. This object encapsulates the UUID and the client's network ID.
Server port: 9999
The Ddpush initiates a server that accepts push tasks at the same time, and the server listens on port 9999. And then, when there's a task to push. We create Pusher.java objects of this class. In this class. Is the 9999 port that is connected to the Ddpush server. The corresponding packet is then sent to the Ddpush. The Ddpush then receives the push task packet. Check the packet format and determine the type of push task.
the simple understanding is that the UDP port is used to listen for and obtain the client information, and the Ddpush server port is used to push the information to the corresponding UUID.
(4) How do I set the UUID? Does each user need to fill in a UUID when using push?
we know, Ddpush give us a client-side instance, need to register a UUID, so that the server to send information to the client, then, in the actual development, every customer just install this software, you have to register it, then repeat what? Actually, in fact, it is not so, every user to register, you can use their ID number as a UUID, not only to ensure the uniqueness, but also more convenient.
Second, Friend League push:
1. principle: You can learn about third-party pushes.
2. features :
( 1 Can achieve a push, but also to achieve unicast, broadcast, multicast, according to the different characteristics of users to push information.
( 2 It is also flexible to push in a variety of forms. You can push notifications and push messages.
3. configuration: (link) http://bbs.umeng.com/thread-7067-1-1.html
(see official documentation for configuration)
4. Questions:
(1) How do you make a push?
It can be pushed based on the alias and Alias_type set, or it can be implemented using Devide_token. When you set alias and Alias_type, the Allies backend server binds to the Devide_token, both of which are essentially the same.
(2) the principle of push
because it is a third-party push reason, actually pushes the information process is the Friend Alliance backstage server to do. Locally, the method in the backend server is actually called.
(3) Server white list configuration
when applying the application, you need to fill in the corresponding server IP, the IP is essentially filtering the appropriate server. If the IP is not on the whitelist, the push will not work. The IP must be a fixed IP and an IP address that the extranet can access.
Third, Ddpush and friends of the league push Comparison:
( 1 ) Friends of the league push is a third-party push, there is a certain dependence. But the function is more powerful.
and Ddpush is not a third-party push, the Ddpush server can be deployed directly on the same computer as its own server.
(2) Push mode and range
Four, Learn to Harvest
1. Myth:
the the understanding of TCP and IP protocols is ambiguous.
Correction: Two independent concepts, can not be confused. The IP protocol is the bottom protocol of TCP, and if you need to understand the details about IP in the TCP protocol, you can view the IP protocol.
2. a summary of network knowledge
(1) the LAN IP configured as fixed IP
http://jingyan.baidu.com/article/5553fa82e368c565a239348e.html
(2) LAN fixed IP is bound to be accessed by the extranet?
here, we first comb two concepts, the extranet and the intranet:
Intranet: That is, the local area network, such as the school's local area network, LAN, each computer's IP address in the local area network has a cross-specific, is not repeatable. But the intranet IP within the two LAN can have the same.
External network: that is, the Internet, the LAN through a server or a router to connect to the network, this IP address is unique. That is to say that all the computers in the intranet are connected to this external network IP, through an external network of IP Exchange data. In other words, the intranet IP of all the computers in a LAN is different, but a common network IP. (The IP Ipconfig/all is your native intranet IP; in the http:// blog.csdn.net/wang379275614/article/details/7856281
So even if the LAN IP to fixed IP, the extranet will still not access to. Then if the need for external network access, you need to do the external network and intranet mapping. You can use nat123 to do port mapping between the extranet and the intranet, and you can use an external domain name to access the local IP. Or the NAT map on the router, configure the server fixed IP, the external network can access. See: http://www.webkaka.com/info/archives/knowledge/2010/10/03496/
The understanding and summary of push