Timeline for A simple TCP server
Current License: CC BY-SA 3.0
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 17, 2020 at 9:04 | history | edited | CommunityBot | Commonmark migration | |
| Mar 31, 2016 at 12:10 | comment | added | Kristoffer Sall-Storgaard | If you use import(."pkgname") all functions will be imported to the current namespace, you can then drop the prefix. eg. import ."fmt"; Println("foo") If you use Sscanf from the fmt package to parse the address instead of regex it'll save you another few bytes, giving you the nice bonus of having Fprintln for returning the total instead of importing strconv. | |
| Mar 31, 2016 at 9:58 | history | edited | dieter | CC BY-SA 3.0 | deleted 99 characters in body |
| Mar 30, 2016 at 20:32 | comment | added | steve | Few more bytes shaved off pastebin.com/HY84sazE - starting to look a bit more "golfed" now | |
| Mar 30, 2016 at 20:04 | comment | added | steve | ...and after then combining a few lines should give you pastebin.com/tMAYn6Y3 Nice work on your first go golf.... | |
| Mar 30, 2016 at 19:56 | comment | added | steve | Dont forget to drop the unnecessary fmt.Println(c.RemoteAddr().String()) line. And to address the @TimmyD point, and avoid having to include 0.0.0.0, use l,_:=n.Listen("tcp",":"+os.Args[1]) | |
| Mar 30, 2016 at 12:33 | comment | added | AdmBorkBork | This doesn't take the listening port as input. | |
| Mar 30, 2016 at 8:32 | comment | added | dieter | @steve I fixed the problem regarding the incorrect sum, thx | |
| Mar 30, 2016 at 8:31 | history | edited | dieter | CC BY-SA 3.0 | fixed a bug : the last byte of the ip was not used for the sum |
| Mar 30, 2016 at 7:30 | comment | added | dieter | @Riking why not ? | |
| Mar 30, 2016 at 7:30 | history | edited | dieter | CC BY-SA 3.0 | added 32 characters in body |
| Mar 30, 2016 at 2:39 | comment | added | VerdantOzark | Hmm, can you not use ":4444" in net.Listen? | |
| Mar 30, 2016 at 2:38 | review | Suggested edits | |||
| Mar 30, 2016 at 3:46 | |||||
| Mar 29, 2016 at 21:49 | comment | added | steve | You could name the strings+strconv packages to save a few bytes. e.g. "strings" becomes s "strings" so that the later strings.Split becomes just s.Split. | |
| Mar 29, 2016 at 21:43 | comment | added | steve | Odd, am getting the result 360 when I connect from 192.168.0.67, rather than 427. | |
| Mar 29, 2016 at 20:52 | comment | added | Numeri | But it sure is a nice language for making a tcp server! | |
| Mar 29, 2016 at 10:37 | history | answered | dieter | CC BY-SA 3.0 |