10/07/09 8:07
GoLDBeRG
eh ma è dove inizia a leggere il socket il problema....
se tu assegni a tutti 0 all'inizio facciamo un esempio...
socket
socket 2 e socket 3
tutti e tre da offset 0....
socket 1 fa il primo byte
intanto anche socket 2 e tre avevano fatto il primo byte...
cosi passano entrambi al 2... ma anche il primo è passato al secondo... e mentre il primo passa al 2 uno degli altri 2 sarà passato al terzo....non funziona cosi... ogni socket deve scaricare la sua e solo la sua partizione di file....in modo da non interferire con l'offset degli altri....
cmq la dimensione del file si puo sapere a priori guarda
Sample
Below is a sample conversation between an HTTP client and an HTTP server running on example.com, port 80.
Client request (followed by a blank line, so that request ends with a double newline, each in the form of a carriage return followed by a line feed):
GET /index.html HTTP/1.1
Host: example.com
The "Host" header distinguishes between various DNS names sharing a single IP address, allowing name-based virtual hosting. While optional in HTTP/1.0, it is mandatory in HTTP/1.1.
Server response (followed by a blank line and text of the requested page):
HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Etag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html; charset=UTF-8
The ETag (entity tag) header is used to determine if a cached version of the requested resource is identical to the current version of the resource on the server. Content-Type specifies the Internet media type of the data conveyed by the http message, while Content-Length indicates its length in bytes. The HTTP/1.1 webserver publishes its ability to respond to requests for certain byte ranges of the document by setting the header Accept-Ranges: bytes. This is useful if the client needs to have only certain portions[8] of a resource sent by the server, which is called byte serving. When Connection: close is sent in a header, it means that the web server will close the TCP connection immediately after the transfer of this package.
solo che non capisco perche io non ricevo quella roba dove ce il content lenght... a me quello serve.....
se tu assegni a tutti 0 all'inizio facciamo un esempio...
socket
socket 2 e socket 3
tutti e tre da offset 0....
socket 1 fa il primo byte
intanto anche socket 2 e tre avevano fatto il primo byte...
cosi passano entrambi al 2... ma anche il primo è passato al secondo... e mentre il primo passa al 2 uno degli altri 2 sarà passato al terzo....non funziona cosi... ogni socket deve scaricare la sua e solo la sua partizione di file....in modo da non interferire con l'offset degli altri....
cmq la dimensione del file si puo sapere a priori guarda
Sample
Below is a sample conversation between an HTTP client and an HTTP server running on example.com, port 80.
Client request (followed by a blank line, so that request ends with a double newline, each in the form of a carriage return followed by a line feed):
GET /index.html HTTP/1.1
Host: example.com
The "Host" header distinguishes between various DNS names sharing a single IP address, allowing name-based virtual hosting. While optional in HTTP/1.0, it is mandatory in HTTP/1.1.
Server response (followed by a blank line and text of the requested page):
HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Etag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html; charset=UTF-8
The ETag (entity tag) header is used to determine if a cached version of the requested resource is identical to the current version of the resource on the server. Content-Type specifies the Internet media type of the data conveyed by the http message, while Content-Length indicates its length in bytes. The HTTP/1.1 webserver publishes its ability to respond to requests for certain byte ranges of the document by setting the header Accept-Ranges: bytes. This is useful if the client needs to have only certain portions[8] of a resource sent by the server, which is called byte serving. When Connection: close is sent in a header, it means that the web server will close the TCP connection immediately after the transfer of this package.
solo che non capisco perche io non ricevo quella roba dove ce il content lenght... a me quello serve.....
aaa