socket通信示例中,当accept客户端时,经常报这个错误。

并且是第一次没有问题,第二次或后面几次都会出现如下问题,

错误码为22, 错误描述为invalid argument.

问题解决如下:

在获取客户端socket fd时,每次都初始化客户端的sockaddr_in结构体,

sockaddr_in client_addr;

memset(&client_addr, 0, sizeof(client_addr));

invalid argument (errno: 22)的更多相关文章

  1. 【Selenium】【BugList9】windows环境,fp = open("./"+ time.strftime("%Y-%m-%d %H:%M:%S") + " result.html",'wb'),报错:OSError: [Errno 22] Invalid argument: './2018-09-05 10:29:32 result.html'

    [代码] if __name__=="__main__": suite = unittest.TestSuite() suite.addTest(Baidu("test_ ...

  2. python使用open的OSError: [Errno 22] Invalid argument错误

    这两天在写一个新闻类的spider时,遇到了OSError: [Errno 22] Invalid argument这个错误,苦恼的两天,无果.后来通过请教学长,发现原来是打开的文件名中含有一些系统的 ...

  3. Python创建文件报错OSError:[Errno 22] Invalid argument处理

    问题: windows平台下使用python open函数w模式打开文件报错“OSError: [Errno 22] Invalid argument: '../news/“消费升维”成零售业新风口? ...

  4. 在使用python语言的open函数时,提示错误OSError: [Errno 22] Invalid argument: ‘文件路径’

    如题,在使用python语言的open函数时,提示错误OSError: [Errno 22] Invalid argument: '文件路径',在查阅了大量资料后也得到了一些解决方案,但是这些解决方案 ...

  5. tensoboard [Errno 22] Invalid argument 以及 Invalid format string问题解决

    Invalid argument 问题解决: 需要保证tensorboard与tensorflow版本一致. Invalid format string 问题解决: 修改 manager.py 文件中 ...

  6. fdisk添加分区引起的Linux Error: 22: Invalid argument

    在Linux服务器(虚拟机)上使用fdisk添加分区.格式化分区后,遇到了Linux Error: 22: Invalid argument错误,操作步骤如下所示 [root@oracle-serve ...

  7. WARNING: Re-reading the partition table failed with error 22: Invalid argument

    在划分磁盘分区时,遇到错误"WARNING: Re-reading the partition table failed with error 22: Invalid argument&qu ...

  8. fastDFS errcode:9 path:Bad file descriptor errcode:22 path:Invalid argument

    fastDFS errcode:9 path:Bad file descriptor errcode:22 path:Invalid argument <error>status:4 er ...

  9. 【Error】IOError: [Errno 22] invalid mode

    使用python打开或写入文件时会报以下错误IOError: [Errno 22] invalid mode,比如打开f:\nnpm.txt时,可以在地址前面加上r或R,即r'f:\nnpm.txt' ...

随机推荐

  1. httprunner运行报错问题:base url missed

    在httprunner运行报错问题 代码书写: 当此段yml文件运行时会出现一下错误 在出现此错误时,为base_url的格式出现错误,只需修改base_url的位置 修改位置后运行yml文件 运行成 ...

  2. Redis持久化 - RDB和AOF

    原文:https://segmentfault.com/a/1190000016021217 一.持久化的作用 1. 什么是持久化 持久化(Persistence),即把数据(如内存中的对象)保存到可 ...

  3. hexo的jacman主题设置语言为英文后偶尔出现中文

    发现这个问题也好久了.问题的具体表现是在根目录下的_config.yml设置了语言为英文,但是每次发布后都会更换一次语言.今天看了文件结构,知道了,每换一次语言“英文.简体中文.繁体中文”,就是这三种 ...

  4. 【Spark】ScalaIDE运行spark,A master URL must be set in your configuration

    or SparkSession.master("local")

  5. 【Android Studio】 资源下载

    Gradle各版本集合 http://services.gradle.org/distributions/ Android Studio各版本集合 http://www.android-studio. ...

  6. Opencv 初探 常用API

    一.介绍 OpenCV是计算机视觉领域应用最广泛的开源工具包,基于C/C++,支持Linux/Windows/MacOS/Android/iOS,并提供了Python,Matlab和Java等语言的接 ...

  7. UNICODE和UCS

    Unicode是国际组织制定的可以容纳世界上所有文字和符号的字符编码方案.目前的Unicode字符分为17组编排,0x0000 至 0xFFFF,每组称为平面(Plane),而每平面拥有65536个码 ...

  8. [Git] Remove Files from Staging Before Committing

    If you've added files to the staging area (the Index) accidentally - you can remove them using git r ...

  9. swap file "*.swp" already exists!的解决方法

    Linux下编程难免要开启多个vim共同编辑同一个文件,这时再次保存就会出现: swap file "*.swp" already exists! [O]pen Read-Only ...

  10. Python中近期Pandas使用总结

    近期做了很多关于数据处理的问题,发现灵活运用pandas包对于数据分析来说可以轻松好多 导包 import numpy as npimport pandas as pdfrom pandas impo ...