b/S Architecture project, a user logged in after the execution of certain actions need to log on the mobile phone corresponding users to push messages
Through the socket implementation
1.socket server: Using the C # window service (the service listens on two ports: platform 8889, Mobile 8881, for example)
2. Platform: In the background interface processing, through the IP and port 8889 connection socket service, send data, the format can be as follows: send|userid| Msg
3. Mobile: Create a long socket connection, access IP and Port 8881, while sending data to the socket service, the format can be as follows: phone|userid| Phone
Implementation: The socket server through the resolution platform and the data sent by the mobile phone comparison, and then by the platform to send the message content sent to the corresponding phone, the phone received the socket server sent over the message after processing, send a local notice (around the Apple APNs, However, when the program enters the background, the socket will be suspended, no messages will be received, and additional processing is required.
The same mobile phone after performing a certain action need to send a message is through the platform background interface access 8889 port and then sent to the phone
iOS Push-b/s architecture-socket