Make buffer not eat all memory.
This commit is contained in:
3
main.go
3
main.go
@@ -9,6 +9,7 @@ import (
|
||||
func main() {
|
||||
log.SetFlags(log.Lshortfile)
|
||||
port := flag.Int("p", 9000, "Port to run server/client on.")
|
||||
addr := flag.String("a", "61.245.149.58", "address to connect to.")
|
||||
isServer := flag.Bool("s", false, "Set if running the server.")
|
||||
flag.Parse()
|
||||
|
||||
@@ -18,7 +19,7 @@ func main() {
|
||||
s.Run()
|
||||
} else {
|
||||
fmt.Printf("Client running on %d\n", *port)
|
||||
c := Client{port: *port}
|
||||
c := Client{port: *port, address: *addr}
|
||||
err := c.Connect()
|
||||
if err != nil {
|
||||
fmt.Print(err)
|
||||
|
||||
Reference in New Issue
Block a user