Changed TCP server into a better working one.