Details
-
Task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Won't Do
-
None
-
None
Description
For applications to work across platforms it would be useful to have a preferred connection type and to configure for this but for the protocol to fall back to socket connections if the preferred connection type doesn't work. For example I'd like domain sockets to be used on Unix systems but my software is also used on Windows systems where these aren't available. So my suggestion is to change the create socket code in MySQLProtocol at line 245 to the following:
// Create socket with timeout if required
String stype = null;
String sname = null;
Options opts = jdbcUrl.getOptions ();
try
{
stype = "pipe"; sname = opts.pipe; if (sname != null) socket = new org.mariadb.jdbc.internal.mysql.NamedPipeSocket (host, sname); else {
stype = "localSocket"; sname = opts.localSocket; if (sname != null) socket = new org.mariadb.jdbc.internal.mysql.UnixDomainSocket (sname); else {
stype = "sharedMemory"; sname = opts.sharedMemory; if (sname != null) socket = new SharedMemorySocket (sname);}}
}
catch (Exception e)
{ System.out.println ("Failed to create " + stype + " '" + sname + "' with error: " + e.toString ()); System.out.flush (); }if (socket == null)
{ socket = socketFactory.createSocket (); }