mirror of
https://github.com/impact-eintr/netstack.git
synced 2025-10-06 05:16:50 +08:00
年轻人的第一条tcp数据 xdm终于拿到客户端送过来的数据了 果然是之前挖的坑 接收窗口初始化了个0 还以为握手没成功在重试...
This commit is contained in:
@@ -2,20 +2,25 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
go func() {
|
||||
_, err := net.Dial("tcp", "192.168.1.1:9999")
|
||||
conn, err := net.Dial("tcp", "192.168.1.1:9999")
|
||||
if err != nil {
|
||||
fmt.Println("err : ", err)
|
||||
return
|
||||
}
|
||||
log.Println("连接建立")
|
||||
conn.Write([]byte("helloworld"))
|
||||
log.Println("发送了数据")
|
||||
conn.Close()
|
||||
}()
|
||||
|
||||
t := time.NewTimer(500 * time.Millisecond)
|
||||
t := time.NewTimer(1000 * time.Millisecond)
|
||||
select {
|
||||
case <-t.C:
|
||||
return
|
||||
|
Reference in New Issue
Block a user