Method enabling terminal establish connections, terminal and server
暂无分享,去创建一个
The invention provides a method enabling a terminal to establish connections, a terminal and a server. The objective of the invention is to solve the problem of incapability to realize communication between a second terminal and a first terminal when the second terminal is in a local area network or the second terminal and the first terminal are located in different local area networkers in the prior art. The method includes the following steps that: the first terminal generates a connection request containing identification information of the second terminal and sends the connection request to the server, and the server is made to transmit the connection request to the second terminal according to the identification information of the second terminal; the first terminal receives a connection request reply message which is generated by the second terminal and contains the candidate addresses of the second terminal and is forwarded by the server, wherein the candidate addresses of the second terminal include the upnp address of the second terminal and port speculation addresses of the second terminal which are distributed in disorder; and the first terminal carries out communication detection according to the candidate addresses of the second terminal, and establishes a connection with the second terminal when communication detection is successful.