Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (n"net"
- t"strings"
- r"strconv"
- x"regexp"
- "os")
- func main(){l,_:=n.Listen("tcp",":"+os.Args[1])
- for{c,_:=l.Accept()
- var s int=0
- for _,i:=range t.Split(x.MustCompile(":[0-9]+$").ReplaceAllLiteralString(c.RemoteAddr().String(),""),"."){
- n,_:=r.Atoi(i)
- s=s+n}
- c.Write([]byte(r.Itoa(s)))
- c.Close()}}
Advertisement
Add Comment
Please, Sign In to add comment