added javadocs to Socket; code cleanup