Objective
Socket is a socket, which is a way of inter-process communication. The socket library hides the underlying, allowing us to focus more on logic. If the short connection and the long connection two probabilities do not understand, will be the pit can not climb up.
Short connection
A complete transfer process, the sender output stream is sent out and closed
Long connections
A TCP long connection is established between the server and the client, and if the sender output stream is not closed, the receiver will not consider the end and will wait until the timeout is reached.
Summarize
Socket programming involves a lot of knowledge points, when encountering problems should refer to the following knowledge points between the process of communication TCP/IP model
The reference connections are: http://blog.csdn.net/yaohonv/article/details/6746410
Long and short connections for Python sockets