Add AbstractSocketServer.startNewThread(), used in tests in next commit.

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1595336 13f79535-47bb-0310-9956-ffa450edef68
Refactor to avoid code duplication.

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1595337 13f79535-47bb-0310-9956-ffa450edef68
Ah ah! Must use flush-immediately or the socket appender may not send all events to the test server right away and tests will fail because the events were not read soon enough!

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1595341 13f79535-47bb-0310-9956-ffa450edef68
Add // comment.

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1595342 13f79535-47bb-0310-9956-ffa450edef68
Stop running the server if the server socket is closed. Now, the super class implements Runnable, so subclasses do not need to.

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1595343 13f79535-47bb-0310-9956-ffa450edef68