Comments (1)
你需要发 clienthello 向酷q端注册、并且两分钟发一次保证不会被酷q端移除
On Monday, 8 August 2016, linexjlin [email protected] wrote:
根据readme 用go写了个client, 可以发送消息,可是接不到消息。
// udp_client project main.go
package mainimport (
"fmt"
"net"
//"strconv"
//"encoding/base64"
"strings"
"time"
)func main() {
begin:
s, e := net.DialUDP("udp4",
&net.UDPAddr{
IP: net.IPv4(127, 0, 0, 1),
Port: 11236,
},
&net.UDPAddr{
IP: net.IPv4(127, 0, 0, 1),
Port: 11235,
})if e != nil { fmt.Println(e) goto begin } fmt.Println("success connect to local upd 11253 ") fmt.Println("localAddr:", s.LocalAddr().String()) lPort := strings.Split(s.LocalAddr().String(), ":")[1] fmt.Println(lPort) // send routine go func() { for { n, e := s.Write([]byte("ClientHello " + lPort)) if e != nil { fmt.Println(e) } fmt.Println("write ", n, "message to", s.RemoteAddr().String()) time.Sleep(time.Second * 20) } }() go func() { for { time.Sleep(time.Second * 5) n, e := s.Write([]byte(`PrivateMessage 379667034 dGVzdCCy4srU`)) //n, e := s.Write([]byte(`PrivateMessage 379667034 dGVzdCDmtYvor5U=`)) if e != nil { fmt.Println(e) } fmt.Println("write ", n, "message to", s.RemoteAddr().String()) //time.Sleep(time.Second * 5) } }() // 接收routine go func() { for { fmt.Println("wait for message from server...") buf := make([]byte, 8) n, _ := s.Read(buf) fmt.Println("receive", n, "bytes message\n the message is:", string(buf)) } }() //wait routine for { time.Sleep(time.Second * 3) }
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#4, or mute the thread
https://github.com/notifications/unsubscribe-auth/ADLuwZpupCmjF-tVcpvSWspSqgd0QROEks5qdhVTgaJpZM4Jei10
.
Dazzy Ding
Email: [email protected]
from cqsocketapi.
Related Issues (13)
- 第一次使用CoolQ,能否写一个readme,方便快速上手 HOT 1
- 建议加入群操作,端口自定义与收到ClientHello后反向发送一次的功能 HOT 14
- 只能接受本地请求,改成 0.0.0.0 更好 HOT 3
- 存在消息无法解码的问题 HOT 5
- 讨论组消息问题 HOT 12
- 不知道是插件问题还是酷q本身的问题 HOT 2
- 新版的酷Q udp客户端好像没法接受消息 HOT 15
- QQ uses GB18030, not GBK HOT 2
- 如何判断Socket API已经部署完成并可用? HOT 4
- 有关新api HOT 1
- 关于在wine中使用本插件的奇怪问题 HOT 9
- 请问这个插件对酷q本身所有功能的适配性如何? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cqsocketapi.