Re: [問題] 抓http檔案
※ 引述《a534055 (可樂)》之銘言:
: 找到問題點了,http封包回200 OK的時候,就已經開始傳檔案
: 我用strlen去算剩下封包的長度,文字檔沒問題,如果是binary file
: strlen 會讀到錯誤的值。
: 實際上資料已經傳完了,是我沒有處理到前面的data
: 感謝熱心寄信給我的版友們
copy from MSDN
int recv (
SOCKET s,
char FAR* buf,
int len,
int flags
);
Return Values
If no error occurs, recv returns the number of bytes received.
If the connection has been gracefully closed, the return value is zero.
Otherwise, a value of SOCKET_ERROR is returned, and a specific error code
can be retrieved by calling WSAGetLastError.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.248.105.226
討論串 (同標題文章)