public class SslNetworkLayer
extends java.lang.Object
implements gov.nist.core.net.NetworkLayer
Constructor and Description |
---|
SslNetworkLayer()
Creates the network layer.
|
Modifier and Type | Method and Description |
---|---|
java.net.DatagramSocket |
createDatagramSocket()
Constructs a datagram socket and binds it to any available port on the
local host machine.
|
java.net.DatagramSocket |
createDatagramSocket(int port,
java.net.InetAddress laddr)
Creates a datagram socket, bound to the specified local address.
|
java.net.ServerSocket |
createServerSocket(int port,
int backlog,
java.net.InetAddress bindAddress)
Creates a server with the specified port, listen backlog, and local IP
address to bind to.
|
java.net.Socket |
createSocket(java.net.InetAddress address,
int port)
Creates a stream socket and connects it to the specified port number at
the specified IP address.
|
java.net.Socket |
createSocket(java.net.InetAddress address,
int port,
java.net.InetAddress myAddress)
Creates a stream socket and connects it to the specified port number at
the specified IP address.
|
java.net.Socket |
createSocket(java.net.InetAddress address,
int port,
java.net.InetAddress myAddress,
int myPort)
Creates a new Socket, binds it to myAddress:myPort and connects it to
address:port.
|
javax.net.ssl.SSLServerSocket |
createSSLServerSocket(int port,
int backlog,
java.net.InetAddress bindAddress)
Creates an SSL server with the specified port, listen backlog, and local
IP address to bind to.
|
javax.net.ssl.SSLSocket |
createSSLSocket(java.net.InetAddress address,
int port)
Creates a stream SSL socket and connects it to the specified port number
at the specified IP address.
|
javax.net.ssl.SSLSocket |
createSSLSocket(java.net.InetAddress address,
int port,
java.net.InetAddress myAddress)
Creates a stream SSL socket and connects it to the specified port number
at the specified IP address.
|
protected javax.net.ssl.SSLServerSocketFactory |
getSSLServerSocketFactory()
Creates a ssl server socket factory.
|
void |
setSipStack(gov.nist.javax.sip.SipStackImpl sipStack) |
protected void |
setTrafficClass(java.net.DatagramSocket s)
Sets the traffic class for the DatagramSocket.
|
protected void |
setTrafficClass(java.net.Socket s)
Sets the traffic class for the Socket.
|
public java.net.ServerSocket createServerSocket(int port, int backlog, java.net.InetAddress bindAddress) throws java.io.IOException
createServerSocket
in interface gov.nist.core.net.NetworkLayer
port
- the portbacklog
- backlogbindAddress
- local address to usejava.io.IOException
- problem creating socket.public java.net.Socket createSocket(java.net.InetAddress address, int port) throws java.io.IOException
createSocket
in interface gov.nist.core.net.NetworkLayer
address
- the address to connect.port
- the port to connect.java.io.IOException
- problem creating socket.public java.net.DatagramSocket createDatagramSocket() throws java.net.SocketException
createDatagramSocket
in interface gov.nist.core.net.NetworkLayer
java.net.SocketException
- problem creating socket.public java.net.DatagramSocket createDatagramSocket(int port, java.net.InetAddress laddr) throws java.net.SocketException
createDatagramSocket
in interface gov.nist.core.net.NetworkLayer
port
- local port to useladdr
- local address to bindjava.net.SocketException
- problem creating socket.public javax.net.ssl.SSLServerSocket createSSLServerSocket(int port, int backlog, java.net.InetAddress bindAddress) throws java.io.IOException
createSSLServerSocket
in interface gov.nist.core.net.NetworkLayer
port
- the port to listen tobacklog
- backlogbindAddress
- the address to listen tojava.io.IOException
- problem creating socket.protected javax.net.ssl.SSLServerSocketFactory getSSLServerSocketFactory() throws java.io.IOException
java.io.IOException
- problem creating factory.public javax.net.ssl.SSLSocket createSSLSocket(java.net.InetAddress address, int port) throws java.io.IOException
createSSLSocket
in interface gov.nist.core.net.NetworkLayer
address
- the address we are connecting to.port
- the port we use.java.io.IOException
- problem creating socket.public javax.net.ssl.SSLSocket createSSLSocket(java.net.InetAddress address, int port, java.net.InetAddress myAddress) throws java.io.IOException
createSSLSocket
in interface gov.nist.core.net.NetworkLayer
address
- the address we are connecting to.port
- the port we use.myAddress
- the local address to usejava.io.IOException
- problem creating socket.public java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress myAddress) throws java.io.IOException
createSocket
in interface gov.nist.core.net.NetworkLayer
address
- the address to connect to.port
- the port we use.myAddress
- the local address to use.java.io.IOException
- problem creating socket.public java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress myAddress, int myPort) throws java.io.IOException
createSocket
in interface gov.nist.core.net.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.java.io.IOException
- if binding or connecting the socket fail for a reason
(exception relayed from the corresponding Socket methods)protected void setTrafficClass(java.net.Socket s)
s
- Socketprotected void setTrafficClass(java.net.DatagramSocket s)
s
- DatagramSocketpublic void setSipStack(gov.nist.javax.sip.SipStackImpl sipStack)
setSipStack
in interface gov.nist.core.net.NetworkLayer
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.