public class SslNetworkLayer extends Object implements NetworkLayer
Constructor and Description |
---|
SslNetworkLayer(SipStackImpl sipStack,
String trustStoreFile,
String keyStoreFile,
char[] keyStorePassword,
char[] trustStorePassword,
String keyStoreType,
String trustStoreType) |
Modifier and Type | Method and Description |
---|---|
DatagramSocket |
createDatagramSocket()
Constructs a datagram socket and binds it to any available port on the local host machine.
|
DatagramSocket |
createDatagramSocket(int port,
InetAddress laddr)
Creates a datagram socket, bound to the specified local address.
|
ServerSocket |
createServerSocket(int port,
int backlog,
InetAddress bindAddress)
Creates a server with the specified port, listen backlog, and local IP address to bind to.
|
Socket |
createSocket(InetAddress address,
int port)
Creates a stream socket and connects it to the specified port number at the specified IP address.
|
Socket |
createSocket(InetAddress address,
int port,
InetAddress myAddress)
Creates a stream socket and connects it to the specified port number at the specified IP address.
|
Socket |
createSocket(InetAddress address,
int port,
InetAddress myAddress,
int myPort)
Creates a new Socket, binds it to myAddress:myPort and connects it to
address:port.
|
SSLServerSocket |
createSSLServerSocket(int port,
int backlog,
InetAddress bindAddress)
Creates an SSL server with the specified port, listen backlog, and local IP address to bind to.
|
SSLSocket |
createSSLSocket(InetAddress address,
int port)
Creates a stream SSL socket and connects it to the specified port number at the specified IP address.
|
SSLSocket |
createSSLSocket(InetAddress address,
int port,
InetAddress myAddress)
Creates a stream SSL socket and connects it to the specified port number at the specified IP address.
|
void |
setSipStack(SipStackImpl sipStackImpl)
Set the sip stack impl so that the network layer can access it to query properties
|
public SslNetworkLayer(SipStackImpl sipStack, String trustStoreFile, String keyStoreFile, char[] keyStorePassword, char[] trustStorePassword, String keyStoreType, String trustStoreType) throws GeneralSecurityException, FileNotFoundException, IOException
public ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddress) throws IOException
NetworkLayer
createServerSocket
in interface NetworkLayer
IOException
public Socket createSocket(InetAddress address, int port) throws IOException
NetworkLayer
createSocket
in interface NetworkLayer
IOException
public DatagramSocket createDatagramSocket() throws SocketException
NetworkLayer
createDatagramSocket
in interface NetworkLayer
SocketException
public DatagramSocket createDatagramSocket(int port, InetAddress laddr) throws SocketException
NetworkLayer
createDatagramSocket
in interface NetworkLayer
SocketException
public SSLServerSocket createSSLServerSocket(int port, int backlog, InetAddress bindAddress) throws IOException
NetworkLayer
createSSLServerSocket
in interface NetworkLayer
IOException
public SSLSocket createSSLSocket(InetAddress address, int port) throws IOException
NetworkLayer
createSSLSocket
in interface NetworkLayer
IOException
public SSLSocket createSSLSocket(InetAddress address, int port, InetAddress myAddress) throws IOException
NetworkLayer
createSSLSocket
in interface NetworkLayer
myAddress
- -- my address.IOException
public Socket createSocket(InetAddress address, int port, InetAddress myAddress) throws IOException
NetworkLayer
createSocket
in interface NetworkLayer
IOException
public Socket createSocket(InetAddress address, int port, InetAddress myAddress, int myPort) throws IOException
createSocket
in interface NetworkLayer
address
- the InetAddress that we'd like to connect to.port
- the port that we'd like to connect tomyAddress
- the address that we are supposed to bind on or null
for the "any" address.myPort
- the port that we are supposed to bind on or 0 for a random
one.IOException
- if binding or connecting the socket fail for a reason
(exception relayed from the correspoonding Socket methods)public void setSipStack(SipStackImpl sipStackImpl)
NetworkLayer
setSipStack
in interface NetworkLayer
Copyright © 2018. All Rights Reserved.