Details
-
Sub-task
-
Resolution: Fixed
-
Major
-
1.0.10
-
None
Description
In SimpleSocketServer.run, the ServerSocket constructor is invoked directly to create a new server socket. This makes it difficult for a subclass to have any influence over the creation of server sockets (e.g. to use an SSL server socket).
If SimpleSocketServer declared a method such as this:
protected ServerSocketFactory getServerSocketFactory() {
return ServerSocketFactory.getDefault()
}
and used it in the run() implementation...
...
serverSocket = getServerSocketFactory().createSocket(port);
...
then a subclass could override it with, for example, an appropriately configured SSLServerSocketFactory...
public class MySSLSimpleSocketServer extends SimpleSocketServer {
...
protected ServerSocketFactory getServerSocketFactory()
...
}
Attachments
Issue Links
- depends on
-
LOGBACK-815 SocketAppenderBase should use a SocketFactory and allow subclasses to provide it
- Closed