The stream of data that I receive has the form (with line numbers added
for reference purposes):
-------cut here--------------
01: HTTP/1.1 200 OK\r\n
02: Content-Type: multipart/x-mixed-replace;boundary=--myboundary\r\n
03: --myboundary\r\n
04: Content-Type: <binary data type>\r\n
05: Time: 2003-01-06 Mon 21:00:05\r\n
06: \r\n
07: <binary data>\r\n
08: --myboundary\r\n
09: Content-Type: <binary data type>\r\n
10: Time: 2003-01-06 Mon 21:00:06\r\n
11: \r\n
12: <binary data>\r\n
13: --myboundary\r\n
14: Content-Type: <binary data type>\r\n
15: Time: 2003-01-06 Mon 21:00:07\r\n
16: ExtraHeader: Some extra data from the sensor\r\n
17: \r\n
18: <binary data>\r\n
19: --myboundary\r\n
...
----------end cut-------------
It would be really cool if cURL set up the following callbacks (or at
least something along these lines):
header_function
Does what the current header function does, e.g. traps line 2
Some part of cURL also detects the multipart header and
recognizes the boundary parameter
subheader_function
Does what header_function does, except it gets called when
there are headers in the multipart section
Traps lines 4, 5, 9, 10, 14, 15, 16
write_function
Instead of trapping lines 3-19 as one big chunk, it now
only returns lines 7, 12, and 18
BTW, great library you have here! After going through the tutorial,
it's pretty easy to use.
从目前web的层面看,flash media server,windows media server都可以考虑。……
[/Quote]
另外关于
multipart/x-mixed-replace
的相关情况,我看到一篇博文介绍的满不错的,
http://blog.csdn.net/gmstart/article/details/7064034