mirror of
https://github.com/impact-eintr/netstack.git
synced 2025-10-07 05:40:52 +08:00
22 lines
331 B
Go
22 lines
331 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"net"
|
|
)
|
|
|
|
func main() {
|
|
conn, err := net.Dial("tcp", "192.168.1.1:9999")
|
|
if err != nil {
|
|
fmt.Println("err : ", err)
|
|
return
|
|
}
|
|
conn.Write([]byte("hello world"))
|
|
//buf := make([]byte, 1024)
|
|
//conn.Read(buf)
|
|
if err = conn.Close(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|