Skip to content

Instantly share code, notes, and snippets.

@fuzzy
Created December 5, 2016 20:55
Show Gist options
  • Save fuzzy/814880b198d229a1a686cd8eb1f3bb90 to your computer and use it in GitHub Desktop.
Save fuzzy/814880b198d229a1a686cd8eb1f3bb90 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net"
"time"
)
func main() {
ts := time.Now().Unix()
for {
conn, _ := net.Dial("tcp", "relay-vip.phl.corp.theplatform.com:2003")
text := fmt.Sprintf("10s.phl.fuzzy.go-client 1 %d\n", ts)
// send to socket
fmt.Fprintf(conn, text)
fmt.Printf("%s", text)
time.Sleep(2 * time.Second)
ts -= 10
conn.Close()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment