fixed cleaning up network client threads when restarting network server
Merge branch 'master' into stephan
fixed bug in buffer, set variable before you use it