Updated so it is now sending and receiving data

Built some log functionality. Still have to carry out shutdown of
connection from server, then build scenario 2 and 3.