1. Technical Field
The disclosure generally relates to methods for data transmission from clients to servers via a network.
2. Description of Related Art
Currently, a large number of computers or servers provided by some web sites or individuals are connected to the Internet. However, parts of these computers or servers may be seldom used or perform the occasional minor task. These computers or servers may be idle at times.
Referring to
Referring to
In step S10, the server 50 is active and a foreground process is running. The foreground process receives a data transmission request from the client 10 through the network 30.
In step S12, the foreground process analyzes a login information from the client 10 to determine if the client 10 has access authorization and replies to the client 10. If the client 10 has authorization, step S14 is implemented. If no authorization, the server 50 rejects the request from the client 10. The server 50 may log an IP address and a name of the client to construct a connection to the client 10 after determining the client 10 has authorization.
In step S14, the server 50 creates a background process.
In step S16, the foreground process receives a data block from the client 10.
In step S18, the background process sends a data report to the client 10 for each data block received by the background process. The client 10 may determine if the received data block is identical to the sent data block. The client 10 may resend the sent data block to the server 50 if the data block received by the server 50 differs from the sent data block. The client 10 may stop sending data blocks to the server 50 after a predetermined period if no data report is received from the server 50. When a plurality of data blocks is transmitted from the client 10 to the server 50, loop through step S16 to step S18 occurs.
In step S20, when the foreground process receives an end data block from the client 10, the data block transmission is finished, the foreground process sends complete inform to the clients 10.
In step S22, the background process is terminated.
Referring to
In step S30, the server 50 receives a status checking request from the client 10.
In step S32, the background process of the server 50 submits a status report to the client 10 in response to the status checking request. The status report indicates one of a normal status and a busy status of the server 50. The client 10 stops sending data blocks to the server 50 when the status report indicates busy status. The data block and the status checking request may be sent to the server 50 simultaneously by the client 10.
Depending on the embodiment, certain of the steps of methods described may be removed, others may be added, and the sequence of steps may be altered. It is also to be understood that the description and the claims drawn to a method may include some indication in reference to certain steps. However, the indication used is only to be viewed for identification purposes and not as a suggestion as to an order for the steps.
It is to be understood, however, that even though numerous characteristics and advantages have been set forth in the foregoing description of preferred embodiments, together with details of the structures and functions of the preferred embodiments, the disclosure is illustrative only, and changes may be made in detail, especially in matters of shape, size, and arrangement of parts within the principles of the invention to the full extent indicated by the broad general meaning of the terms in which the appended claims are expressed.
Number | Date | Country | Kind |
---|---|---|---|
200910308044.X | Sep 2009 | CN | national |