# HG changeset patch # User Mahlon E. Smith # Date 1518658049 28800 # Node ID 1f366fc6159260410a0e853735e291d6cbd665ff # Parent a1276c3d39ebf3f553401bacfecfcf321274f13f Each incoming connection requires its own client socket. diff -r a1276c3d39eb -r 1f366fc61592 netdata_tsrelay.nim --- a/netdata_tsrelay.nim Wed Feb 14 15:41:11 2018 -0800 +++ b/netdata_tsrelay.nim Wed Feb 14 17:27:29 2018 -0800 @@ -200,9 +200,7 @@ let db = open( "", "", "", conf.dbopts ) if conf.verbose: echo( "Successfully connected to the backend database.".hl( fgGreen ) ) - var - server = newSocket() - client = newSocket() + var server = newSocket() server.set_sock_opt( OptReuseAddr, true ) server.bind_addr( Port(conf.listen_port), conf.listen_addr ) @@ -218,7 +216,10 @@ echo "" while true: + var client = newSocket() var address = "" + + client.close server.acceptAddr( client, address ) # blocking call spawn runthread( client, address, db, conf )