作者: | 来源:互联网 | 2023-09-02 18:15
聊天软件基础–how insta
聊天软件基础–how instant message work
这里instant message
是正真的即时,不支持离线
-
You go to the download page and get a copy of the free software client for your computer.
-
You install the software and open the client.
-
The client tries to connect to the server. It uses a proprietary protocol for communication.
-
Once the client is connected to the server, you can enter your name and password to log in to the server. If this is your first time on, you can sign up for an account and immediately begin using it. When the server verifies your name and password, you are logged in.
-
The client sends the server the connection information (IP address and number of the port assigned to the client) of the computer you are using. It also provides the user with the names of everyone in your contacts list.
-
The server creates a temporary file that has the connection information for you and the list of your contacts. It then checks to see if any of the users in your contact list are currently logged in.
-
If the server finds any of your contacts logged in, it sends a message back to the client on your computer with the connection information for that user. The server also sends your connection information to the people in your contact list that are signed on.
-
When your client gets the connection information for a person in your contact list, it changes the status of that person to “online.” You click on the name of a person in your contact list who is online, and a window opens that you can enter text into. You enter a message and click “send” or hit return to communicate with that person.
-
Because your client has the IP address and port number for the computer of the person that you sent the message to, your message is sent directly to the client on that person’s computer. In other words, the server is not involved at this point. All communication is directly between the two clients.(server 有点类似地图,他有你的source和destination,然后规划路线)
-
The other person gets your instant message and responds. The window that each of you sees on your respective computers expands to include a scrolling dialog of the conversation. Each person’s instant messages appears in this window on both computers.
-
When the conversation is complete, you close the message window. Eventually, you go offline and exit. When this happens, your client sends a message to the server to terminate the session. The server sends a message to the client of each person on your contact list who is currently online to indicate that you have logged off. Finally, the server deletes the temporary file that contained the connection information for your client. In the clients of your contacts that are online, your name moves to the offline status section.
转载