use packet encoder/decoder in server loop