use reference instead of pointer
wrap socket send and receive