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. ShortKey – Visual Studio/VS Code etc.

    Switching between .h and .cppIn Visual Studio 2013 and later :there is a default keyboard shortcut f ...

  2. Apache JMeter系列.1

    最爱看统计 --01-- 简介 Apache JMeter Apache JMeter可用于测试静态和动态资源(文件,Servlet,Perl脚本,Java对象,数据库和查询,FTP服务器等)的性能. ...

  3. 【比赛游记】(THUPC,CTS,APIO)2019四连爆蛋记

    5 月 11 日 坐飞机来到帝都,报道 THUPC. 试机题有皮配,不会. 晚上吃全聚德,喝星巴克.奢侈. 5 月 12 日 早上打 THUPC. 咕到 9 点半开始,到 2 点半结束.

  4. shell脚本攻略1

    换行符 \n echo -n 禁止换行 环境变量声明export export PATH="$PATH:/home/user/bin" 获取字符串的长度 length=${#var ...

  5. Elasticsearch 概念理解

    官方文档地址 Filebeat: https://www.elastic.co/cn/products/beats/filebeat https://www.elastic.co/guide/en/b ...

  6. Nginx——跨域造成的504问题

    前言 前台域名和后台域名是两个不同不同的二级域名,访问的时候造成了跨域,出现了504错误 解决 修改Nginx配置,将超时的时间设置为1200秒 keepalive_timeout 1200; pro ...

  7. oc语言源代码

    ? https://opensource.apple.com/source/objc4/objc4-493.9/runtime/

  8. Blink示例程序

    打开Arduino IDE(话说与Processing IDE的UI好像啊 然后将这段代码输入.也可从文件>例子>01.Basics/Blink(File/Examples/01.Basi ...

  9. HDU 6583 Typewriter(后缀自动机)

    Typewrite \[ Time Limit: 1500 ms\quad Memory Limit: 262144 kB \] 题意 给出一个字符串 \(s\),现在你需要构造出这个字符串,你每次可 ...

  10. 05_配置交换机SSH服务(数通华为)

    1. 网络拓扑: 2. SW1配置:2.1 配置为Access口,vlan 10:[SW1]vlan 10[SW1-GigabitEthernet0/0/1]port link-type access ...