import networking code from UPro, first commit