summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-08-06 21:47:05 +0200
committerWim <wim@42.be>2018-08-06 21:47:05 +0200
commit51062863a5c34d81e296cf15c61140911037cf3b (patch)
tree9b5e044672486326c7a0ca8fb26430f37bf4d83c /vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go
parent4fb4b7aa6c02a54db8ad8dd98e4d321396926c0d (diff)
downloadmatterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.tar.gz
matterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.tar.bz2
matterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.zip
Use mod vendor for vendored directory (backwards compatible)
Diffstat (limited to 'vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go')
-rw-r--r--vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go42
1 files changed, 0 insertions, 42 deletions
diff --git a/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go b/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go
deleted file mode 100644
index 83c80ad1..00000000
--- a/vendor/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package main
-
-import (
- "flag"
- "fmt"
- "net"
- "os"
-)
-
-var (
- port = flag.String("p", "12124", "Port number to listen on")
-)
-
-func e(err error) {
- if err != nil {
- fmt.Printf("Erroring out: %s\n", err)
- os.Exit(1)
- }
-}
-
-func main() {
- flag.Parse()
-
- // Bind to the port
- bind, err := net.ResolveUDPAddr("0.0.0.0:" + *port)
- e(err)
-
- // Create listener
- listener, err := net.ListenUDP("udp", bind)
- e(err)
-
- fmt.Printf("Listening to port %s...\n", *port)
- for {
- // read into a new buffer
- buffer := make([]byte, 1024)
- _, _, err := listener.ReadFrom(buffer)
- e(err)
-
- // log to standard output
- fmt.Println(string(buffer))
- }
-}