Details
- 
    
Task
 - 
    Status: Closed (View Workflow)
 - 
    
Minor
 - 
    Resolution: Fixed
 - 
    1.1.2
 - 
    None
 - 
    None
 - 
    None
 - 
    Linux, JDK 1.7
 
Description
Its possible to use a custom SocketFactory. To use unix Sockets theres exist a project called junixsocket here:
http://code.google.com/p/junixsocket/
I've writte a custom SocketFactory which does create unix sockets - but the code does force the connect to an
InetSocketAddress sockAddr = new InetSocketAddress(host, port);
in connect of MySQLProtocol class - which are of cause not supported and denied by the AFUnixSocket implementation.
I've patched the Protocol class to read like this:
					       String unixSocket = info.getProperty("unixsocket");
			 | 
		
					        if (unixSocket == null) {
			 | 
		
					          if (connectTimeout != null) {
			 | 
		
					            socket.connect(sockAddr, connectTimeout * 1000);
			 | 
		
					          } else {
			 | 
		
					            socket.connect(sockAddr);
			 | 
		
					          }    
			 | 
		
					        }
			 | 
		
and did specify the property unixsocket - value does not matter - to the properties given to the Driver class.
After that i was able to use AF_UNIX Sockets.
Would be nice if its possible to get some patch or property switch like this one, to make use of them.
Or maybe use a custom SocketFactory interfae like connector/J does.