The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
woop/aws-code/listen.go

27 lines
369 B

package main
import (
7 years ago
"fmt"
"io"
"net"
"time"
)
func listenMain() { // TODO: temp fix to unblock test
7 years ago
ln, err := net.Listen("tcp", "localhost:9000")
if err != nil {
panic(err)
}
defer ln.Close()
7 years ago
for {
conn, err := ln.Accept()
if err != nil {
panic(err)
}
7 years ago
io.WriteString(conn, fmt.Sprint("Hello World\n", time.Now(), "\n"))
conn.Close()
}
7 years ago
}