recv of packet and message now happens in functions instead of manually parsing strings from sockets; broken