Added deconstructor to close socket and moved setRemote to child.