Why three-way handshake:
Let the server and the client know that their reception capacity and signaling capability is no problem;
First: The client sent to the server - the server know, their reception capacity and signaling capabilities of the client there is no problem;
Second: the server replies to the client - the client knows that he's receiving signaling capability and ability there is no problem, or do not receive a reply of the server; the server receiving signaling capability and the ability to no problem, otherwise the server does not receive a reply;
Third: Client reply server - the server knows that his receiving ability signaling capability and the client is no problem;
over
Why four wave:
First: the client tells the server: I ran out, you can end links;
Second: the server tell the client: I know, but I might need something to you, may not be what you have been given, but I can not tell you I would immediately close links;
Third: the server tell the client: When the server to determine what he did to the client, it will tell the client, can close links;
Fourth: the client tells the server: Yes, I shut up, you close it, so the server has been closed;
over
TCP and UDP difference between (Socket)