Added some socket code