US 12,010,088 B2
Data sending method and apparatus, and method and system for establishing P2P connection
Shunli Liang, Shanghai (CN); Hanchao Zheng, Shanghai (CN); Honglei Cui, Shanghai (CN); Hao Wang, Shanghai (CN); and Biao Hu, Shanghai (CN)
Assigned to SHANGHAI BILIBILI TECHNOLOGY CO., LTD., Shanghai (CN)
Appl. No. 18/271,024
Filed by SHANGHAI BILIBILI TECHNOLOGY CO., LTD., Shanghai (CN)
PCT Filed Jan. 5, 2022, PCT No. PCT/CN2022/070246
§ 371(c)(1), (2) Date Jul. 5, 2023,
PCT Pub. No. WO2022/148364, PCT Pub. Date Jul. 14, 2022.
Claims priority of application No. 202110011585.7 (CN), filed on Jan. 6, 2021.
Prior Publication US 2024/0064124 A1, Feb. 22, 2024
Int. Cl. H04L 61/2517 (2022.01); H04L 101/695 (2022.01)
CPC H04L 61/2517 (2013.01) [H04L 2101/695 (2022.05)] 20 Claims
OG exemplary drawing
 
1. A method of sending data, applied to a terminal device associated with symmetric network address translation (NAT), the method comprising:
establishing a queue for accommodating m file descriptors for generating n1 first access request data packets to be sent from the terminal device, wherein 2≤m<n1;
creating an ith file descriptor in the queue, generating and sending an ith first access request data packet by using the ith file descriptor, and monitoring a source port recorded by the ith file descriptor, wherein the ith file descriptor corresponds to a same source port as the ith first access request data packet, and 1≤i≤n1;
at every first preset time interval t1, enabling i to automatically increase by 1, continuing to perform operations of creating an (i+1)th file descriptor in the queue, generating and sending an (i+1)th first access request data packet by using the (i+1)th file descriptor, and monitoring a source port recorded by the (i+1)th file descriptor, and setting a preset monitoring time T for each source port, wherein each file descriptor records a different source port, and T=t1*m;
ending monitoring of an (i-m)th source port and destroying a corresponding file descriptor while creating a file descriptor in the queue when m*j<i≤m*(j+1), wherein j≥1; and
stopping monitoring other source ports in response to detecting that a first port of the terminal device receives a response data packet, and wherein the first port is any source port in a monitored state.