Started writing socket code. Not tested yet