fwrite 接收文件错误

  FILE *stream;
					   if ((stream = fopen("abc.txt", "w+")) == NULL)
					   {
						   break;
					   }
					   int ret_recv = -100;
					   while (1)
					   {
						   char request[4068] = { 0 };
						   memset(request, 0, 4068);
						   ret_recv = recv(fd, request, sizeof(request), 0); 

						   if (ret_recv == -1)
						   {
							   break;
						   }
						   fseek(stream, 0, SEEK_END);
						   if (fwrite(request, 1, ret_recv, stream) < 0){
							 
							   fclose(stream);
						   }
						   fflush(stream);
					   }
					
					 
					   fclose(stream); 
				     

  

上一篇:Django Ajax动态图形监控


下一篇:OpenCV算法加速(1)基础知识