Я построил файловый сервер на Java, и у меня возникают трудности с пониманием того, когда мне следует начать предоставлять данные файла. Как вы можете видеть ниже, это два разных клиентских запроса. Некоторые предоставляют два запроса, и я не уверен, когда я должен начать предоставлять данные, и когда я должен «игнорировать».
Клиент № 1:
06-15 08:06:21.290: VERBOSE/HttpSession(9425): SESSION 1: STARTED
06-15 08:06:21.290: INFO/HttpSession(9425): CLIENT:
06-15 08:06:21.290: INFO/HttpSession(9425): GET /stream HTTP/1.1
06-15 08:06:21.290: INFO/HttpSession(9425): Host: 127.0.0.1:37914
06-15 08:06:21.290: INFO/HttpSession(9425): User-Agent: (Linux)
06-15 08:06:21.290: INFO/HttpSession(9425): SERVER:
06-15 08:06:21.290: INFO/HttpSession(9425): HTTP/1.1 200 OK
06-15 08:06:21.290: INFO/HttpSession(9425): Date: Wed, 15 Jun 2011 12:06:21 GMT
06-15 08:06:21.290: INFO/HttpSession(9425): Server: HTTP Server
06-15 08:06:21.290: INFO/HttpSession(9425): Last-Modified: Mon, 06 Aug 2009 01:02:23 GMT
06-15 08:06:21.290: INFO/HttpSession(9425): Accept-Ranges: none
06-15 08:06:21.290: INFO/HttpSession(9425): Content-Type: audio/mpeg
06-15 08:06:21.290: INFO/HttpSession(9425):
06-15 08:06:26.720: VERBOSE/HttpSession(9425): SESSION 2: STARTED
06-15 08:06:26.730: INFO/HttpSession(9425): CLIENT:
06-15 08:06:26.730: INFO/HttpSession(9425): GET /stream HTTP/1.1
06-15 08:06:26.730: INFO/HttpSession(9425): Host: 127.0.0.1:37914
06-15 08:06:26.730: INFO/HttpSession(9425): Accept: */*
06-15 08:06:26.730: INFO/HttpSession(9425): SERVER:
06-15 08:06:26.730: INFO/HttpSession(9425): HTTP/1.1 200 OK
06-15 08:06:26.730: INFO/HttpSession(9425): Date: Wed, 15 Jun 2011 12:06:26 GMT
06-15 08:06:26.730: INFO/HttpSession(9425): Server: HTTP Server
06-15 08:06:26.730: INFO/HttpSession(9425): Last-Modified: Mon, 06 Aug 2009 01:02:23 GMT
06-15 08:06:26.730: INFO/HttpSession(9425): Accept-Ranges: none
06-15 08:06:26.730: INFO/HttpSession(9425): Content-Type: audio/mpeg
06-15 08:06:26.730: INFO/HttpSession(9425):
06-15 08:06:26.730: VERBOSE/HttpSession(9425): SESSION 2: ENDED
Клиент № 2:
06-15 05:03:58.079 I/HttpSession(18335): CLIENT:
06-15 05:03:58.079 I/HttpSession(18335): GET /stream HTTP/1.1
06-15 05:03:58.079 I/HttpSession(18335): Host: 127.0.0.1
06-15 05:03:58.079 I/HttpSession(18335): Accept: */*
06-15 05:03:58.079 I/HttpSession(18335): Icy-MetaData:1
06-15 05:03:58.079 I/HttpSession(18335): User-Agent: QuickTime;NvMM HTTP Client v0.1
06-15 05:03:58.089 I/HttpSession(18335): SERVER:
06-15 05:03:58.089 I/HttpSession(18335): HTTP/1.1 200 OK
06-15 05:03:58.089 I/HttpSession(18335): Date: Wed, 15 Jun 2011 09:03:58 GMT
06-15 05:03:58.089 I/HttpSession(18335): Server: HTTP Server
06-15 05:03:58.089 I/HttpSession(18335): Last-Modified: Mon, 06 Aug 2009 01:02:23 GMT
06-15 05:03:58.089 I/HttpSession(18335): Accept-Ranges: bytes
06-15 05:03:58.089 I/HttpSession(18335): Content-Type: audio/mpeg