Advertisement
Guest User

Untitled

a guest
Mar 30th, 2016
164
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2. import(n"net";t"strings";r"strconv";x"regexp";"os")
  3. func main(){l,_:=n.Listen("tcp",":"+os.Args[1])
  4. for{c,_:=l.Accept();var s int
  5. for _,i:=range t.Split(x.MustCompile(":[0-9]+$").ReplaceAllLiteralString(c.RemoteAddr().String(),""),"."){
  6. n,_:=r.Atoi(i);s=s+n};c.Write([]byte(r.Itoa(s)));c.Close()}}
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement