dou47732 2017-12-09 03:28
浏览 51
已采纳

如何在不禁用错误报告的情况下抑制fputs,fsockopen等警告?

I use fsockopen, fgets and fputs to implement communication protocol with other machine. NetBeans give warning to all '@' before fsockopen, fputs, fgets etc. The solution works but without '@' after disconnection of remote device there are warnings (not errors).

I don't want to use error_reporting because it is not more kosher solution. Additionally more code, longer execution time...

Is there any better solution for this?

BTW. the warnings occurs if the destination machine will drop connection. It is possible if device is overload.

$answer=@fgets($socket, $negotiatedMaxLength);

BTW. The solution should work without ini_set - blocked on server and without error_reporting().

  • 写回答

1条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 普罗米修斯Prometheus监控系统的几个问题调研
      • ¥15 pmp项目管理干系人分析
      • ¥15 请问DenseNet图像输入大小是否是固定的?
      • ¥15 template模板的参数问题
      • ¥15 查找处理学生信息问题,含多个文件,显示问题是无法调用其中一个文件
      • ¥15 simulink生成代码后提示告警
      • ¥16 jieba提取高频词,生成文件是空的
      • ¥15 怎么读取服务器中的文件去配置mongo的连接
      • ¥20 Python如何统计文本中两字及以上的词语个数
      • ¥15 MapReduce自定义对象怎么写