Optimize net client and server