udp client 第二次操作时报错 write: connection refused
来源:互联网 发布:中国出口数据查询 编辑:程序博客网 时间:2024/06/05 07:11
今天在用go land写个模拟数据发生工具,要udp广播发多个数据,但总是在第二次发送时报错。
sock, err := net.Dial("udp", "0.0.0.0:6000") defer sock.Close() if err != nil { os.Exit(1) } for i:=0; i<*count && startNo > 0; i++{ msg, err := haihua.GetMockMsg(startNo, conn) if err != nil{ log.Fatal("mock msg failed:", err.Error()) } data := []byte(msg.Src) n, err := sock.Write(data) if err != nil { log.Fatal("Query failed:", err.Error()) } startNo = msg.Id }
网上说了很多原因,但和我无关
最后发现,我想广播到所有网卡,使用了 0.0.0.0:6000
把目标地址换了 192.168.139.0:6000 就不会了发生错误了
阅读全文
0 0
- udp client 第二次操作时报错 write: connection refused
- 解决Linux5在telnet时报错“Unencrypted connection refused. Goodbye.”
- Socket通信时报错java.net.ConnectException: Connection refused
- PIG执行MR时报Connection refused错误
- UDP怎么会返回Connection refused错误
- 更新android sdk时报错 Connection to https://dl-ssl.google.com refused
- 配置redis主从时报错:Error condition on socket for SYNC: Connection refused
- 配置redis主从时报错:Error condition on socket for SYNC: Connection refused
- Kylin: Extract Fact Table Distinct Columns 时报错java.net.ConnectException: Connection refused
- Redis连接时报错:Could not connect to Redis at 127.0.0.1:6379: Connection refused
- git报错Connection refused
- HDFS报错:Connection refused!
- testng进行单元测试时报错Software caused connection abort: socket write error解决方法
- 服务器使用本机安装的tomcat,用http协议访问网络时报错java.net.ConnectException: Connection refused
- connection refused
- Python3.6请求网站时报错:http.client.RemoteDisconnected: Remote end closed connection without response
- hadoop安装--排错2 connection refused
- 运行时报的异常Caused by: java.net.ConnectException: Connection refused: no further information
- php 冒泡排序 快速排序 二分查找
- 吴恩达最新满满干货告诉你,怎样才能成为真正的AI公司(附视频)
- 100+经典Java面试题及答案解析
- tmux配置
- 关于一个STM32编译报错问题,变量声明不能在语句后面
- udp client 第二次操作时报错 write: connection refused
- LintCode-分治-二叉树中的最大路径和
- 新建对象时 属性发生的变化
- C语言转换大小写
- 7、Zookeeper场景案例分析
- Http的无状态性
- 三次握手与四次挥手
- linux系统存入mysql的中文数据乱码???? linux版MySQL设置utf-8及其问题大坑
- Consul centos 安装