Skip to content

Instantly share code, notes, and snippets.


evanj/tcpping.go Secret

Created Dec 18, 2015
What would you like to do?
tcpping: Send a sequence of plain text messages over TCP
package main
import (
func main() {
conn, err := net.Dial("tcp", os.Args[1])
if err != nil {
defer conn.Close()
for i := 0; true; i++ {
message := fmt.Sprintf("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa %d\n", i)
_, err = conn.Write([]byte(message))
if err != nil {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment