added socket handling
added readMessage and writeMessage