network fixes

can send and receive packets now. I need to fix the concurrency issue
and seperate the functionality along with clean up the code.