[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eSocketFactory\u003c/code\u003e class extends \u003ccode\u003eSocketFactory\u003c/code\u003e and inherits from \u003ccode\u003ejava.lang.Object\u003c/code\u003e, providing methods for creating sockets.\u003c/p\u003e\n"],["\u003cp\u003eThe class has a constructor \u003ccode\u003eSocketFactory(Properties properties)\u003c/code\u003e that takes \u003ccode\u003eProperties\u003c/code\u003e as a parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecreateSocket()\u003c/code\u003e method, which is overridden from the parent \u003ccode\u003eSocketFactory\u003c/code\u003e class, is used to return a new socket, and also can throw an \u003ccode\u003eIOException\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSeveral overridden \u003ccode\u003ecreateSocket\u003c/code\u003e methods allow socket creation with various parameters, including host, port, and \u003ccode\u003eInetAddress\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this implementation is \u003ccode\u003e0.2.0\u003c/code\u003e, which is the version used in this documentation.\u003c/p\u003e\n"]]],[],null,["# Class SocketFactory (0.2.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.2.0 (latest)](/java/docs/reference/alloydb-jdbc-connector/latest/com.google.cloud.alloydb.SocketFactory)\n- [0.1.2](/java/docs/reference/alloydb-jdbc-connector/0.1.2/com.google.cloud.alloydb.SocketFactory) \n\n public class SocketFactory extends SocketFactory\n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e [SocketFactory](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html) \\\u003e SocketFactory \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-) \n[SocketFactory.createSocket()](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket--) \n[SocketFactory.createSocket(String,int)](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket-java.lang.String-int-) \n[SocketFactory.createSocket(String,int,InetAddress,int)](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket-java.lang.String-int-java.net.InetAddress-int-) \n[SocketFactory.createSocket(InetAddress,int)](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket-java.net.InetAddress-int-) \n[SocketFactory.createSocket(InetAddress,int,InetAddress,int)](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket-java.net.InetAddress-int-java.net.InetAddress-int-) \n[SocketFactory.getDefault()](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#getDefault--)\n\nConstructors\n------------\n\n### SocketFactory(Properties properties)\n\n public SocketFactory(Properties properties)\n\nMethods\n-------\n\n### createSocket()\n\n public Socket createSocket()\n\n**Overrides** \n[SocketFactory.createSocket()](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket--)\n\n### createSocket(String host, int port)\n\n public Socket createSocket(String host, int port)\n\n**Overrides** \n[SocketFactory.createSocket(String,int)](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket-java.lang.String-int-)\n\n### createSocket(String host, int port, InetAddress localHost, int localPort)\n\n public Socket createSocket(String host, int port, InetAddress localHost, int localPort)\n\n**Overrides** \n[SocketFactory.createSocket(String,int,InetAddress,int)](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket-java.lang.String-int-java.net.InetAddress-int-)\n\n### createSocket(InetAddress host, int port)\n\n public Socket createSocket(InetAddress host, int port)\n\n**Overrides** \n[SocketFactory.createSocket(InetAddress,int)](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket-java.net.InetAddress-int-)\n\n### createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)\n\n public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)\n\n**Overrides** \n[SocketFactory.createSocket(InetAddress,int,InetAddress,int)](https://docs.oracle.com/javase/8/docs/api/javax/net/SocketFactory.html#createSocket-java.net.InetAddress-int-java.net.InetAddress-int-)"]]