Method of maintaining a connection and electronic apparatus using the same
First Claim
1. A method of maintaining a network connection, used between an electronic apparatus and a server, the method comprising:
- (a) sending an Nth test packet to the server, wherein the Nth test packet requests that the server reply to the electronic apparatus after waiting for an Nth time interval, wherein N is a positive integer;
(b) determining whether a reply for the Nth test packet is received, wherein the reply is sent by the server;
(c) repeating sending the Nth test packet to the server if the reply for the Nth test packet is received;
if the reply for the Nth test packet is not received, repeatedly sending an (N−
1)th test packet and determining whether replies for all the (N−
1)th test packets which are repeatedly sent by the server are received;
(d) if the replies for all the (N−
1)th test packets repeatedly sent by the server are received, calculating a time from the (N−
1)th test packet being sent to the reply from the server being received as a period;
if not all the replies for all the (N−
1)th test packets repeatedly sent by the server are received, calculating a time from an (N−
2)th test packet being sent to a reply for the (N−
2)th test packet from the server being received as the period; and
(e) sending a keep-alive packet to the server according to the period for maintaining a connection between the electronic apparatus and the server when the electronic apparatus is switched to a standby/sleep mode.
1 Assignment
0 Petitions
Accused Products
Abstract
A method of maintaining a network connection is used between an electronic apparatus and a server. The method includes the following steps: (a) sending an Nth test packet to the server, and the Nth test packet requests that the server reply to the electronic apparatus after waiting for an Nth time interval; (b) determining whether a reply for the Nth test package is received; (c) repeating step (a) if the reply for the Nth test packet is received; and calculating a period from the (N−1)th test packet being sent to the reply from the server being received if the reply for the Nth test packet is not received; and (d) sending a keep-alive packet periodically to the server according to the period for maintaining a connection between the electronic apparatus and the server when the electronic apparatus is switched to a standby/sleep mode.
12 Citations
5 Claims
-
1. A method of maintaining a network connection, used between an electronic apparatus and a server, the method comprising:
-
(a) sending an Nth test packet to the server, wherein the Nth test packet requests that the server reply to the electronic apparatus after waiting for an Nth time interval, wherein N is a positive integer; (b) determining whether a reply for the Nth test packet is received, wherein the reply is sent by the server; (c) repeating sending the Nth test packet to the server if the reply for the Nth test packet is received;
if the reply for the Nth test packet is not received, repeatedly sending an (N−
1)th test packet and determining whether replies for all the (N−
1)th test packets which are repeatedly sent by the server are received;(d) if the replies for all the (N−
1)th test packets repeatedly sent by the server are received, calculating a time from the (N−
1)th test packet being sent to the reply from the server being received as a period;
if not all the replies for all the (N−
1)th test packets repeatedly sent by the server are received, calculating a time from an (N−
2)th test packet being sent to a reply for the (N−
2)th test packet from the server being received as the period; and(e) sending a keep-alive packet to the server according to the period for maintaining a connection between the electronic apparatus and the server when the electronic apparatus is switched to a standby/sleep mode. - View Dependent Claims (2, 3, 4, 5)
-
Specification