摘要 |
The present invention discloses a method and an apparatus for accessing resources. The method includes: obtaining the IP address of the server corresponding to the resources (S110); according to the IP address, establishing a TCP connection with the server, so as to obtain the resources from the server through the TCP connection after receiving the resource request message, sent from a terminal, for requesting the resources (S120). The apparatus includes an obtaining module and a connection module, wherein the obtaining module is used for obtaining the IP address of the server corresponding to the resources, and the connection module is used for establishing a TCP connection with the server according to the IP address, so as to obtain the resources from the server through the TCP connection after receiving the resource request message, sent from a terminal, for requesting the resources. The method and apparatus of the present invention, establish the TCP connection with the server in advance, before the terminal requests the resources and after the IP address of the server corresponding to the resources is obtained, thus decreasing the network delay and enhancing the user experience. |