Skip to content

Instantly share code, notes, and snippets.

@mstrYoda
Created February 5, 2023 17:55
Show Gist options
  • Save mstrYoda/75a1ecf966487fac78a3bc5e45d6b2ea to your computer and use it in GitHub Desktop.
Save mstrYoda/75a1ecf966487fac78a3bc5e45d6b2ea to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net"
"os"
"time"
)
func main() {
conn, err := net.Dial("tcp", "127.0.0.1:8080")
if err != nil {
panic(err)
}
for {
n, err := conn.Write([]byte("hello"))
if err != nil {
fmt.Println(err)
}
fmt.Fprintf(os.Stdout, "writted: %d \n", n)
time.Sleep(3 * time.Second)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment