add client and server socket factory methods to Socket class, to allow plugins to customize this behavior