You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
|
7 years ago
|
package com.zerotier.libzt;
|
||
|
|
|
||
|
|
import com.zerotier.libzt.ZeroTier;
|
||
|
|
import com.zerotier.libzt.ZeroTierSocket;
|
||
|
|
|
||
|
|
import java.io.IOException;
|
||
|
|
import java.net.InetAddress;
|
||
|
|
import java.net.Socket;
|
||
|
|
import java.net.UnknownHostException;
|
||
|
|
import javax.net.SocketFactory;
|
||
|
|
import java.util.Objects;
|
||
|
|
|
||
|
|
public class ZeroTierSocketFactory extends SocketFactory
|
||
|
|
{
|
||
|
|
public ZeroTierSocketFactory() { }
|
||
|
|
|
||
|
|
public static SocketFactory getDefault()
|
||
|
|
{
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
public Socket createSocket()
|
||
|
|
throws IOException, UnknownHostException
|
||
|
|
{
|
||
|
|
return new ZeroTierSocket();
|
||
|
|
}
|
||
|
|
|
||
|
|
public Socket createSocket(String host, int port)
|
||
|
|
throws IOException, UnknownHostException
|
||
|
|
{
|
||
|
|
return new ZeroTierSocket(host, port);
|
||
|
|
}
|
||
|
|
|
||
|
|
public Socket createSocket(String host, int port, InetAddress localHost, int localPort)
|
||
|
|
throws IOException, UnknownHostException
|
||
|
|
{
|
||
|
|
return new ZeroTierSocket(host, port, localHost, localPort);
|
||
|
|
}
|
||
|
|
|
||
|
|
public Socket createSocket(InetAddress host, int port)
|
||
|
|
throws IOException
|
||
|
|
{
|
||
|
|
return new ZeroTierSocket(host, port);
|
||
|
|
}
|
||
|
|
|
||
|
|
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort)
|
||
|
|
throws IOException
|
||
|
|
{
|
||
|
|
return new ZeroTierSocket(address, port, localAddress, localPort);
|
||
|
|
}
|
||
|
|
}
|