memetic.crypto
Class EncryptedRTPSocket

java.lang.Object
  extended by java.net.DatagramSocket
      extended by java.net.MulticastSocket
          extended by memetic.crypto.EncryptedRTPSocket

public class EncryptedRTPSocket
extends java.net.MulticastSocket

An Encrpyted RTP Datagram Socket

Version:
1-1-alpha3
Author:
Andrew G D Rowley

Constructor Summary
EncryptedRTPSocket(RTPCrypt crypt, java.net.InetAddress addr, int port)
          Creates a new EncryptedRTPSocket bound to the specified port
EncryptedRTPSocket(RTPCrypt crypt, java.net.InetAddress addr, int port, boolean isRTP)
          Creates a new EncryptedRTPSocket bound to the specified port
EncryptedRTPSocket(RTPCrypt crypt, int port)
          Creates a new EncryptedRTPSocket bound to the specified port
EncryptedRTPSocket(RTPCrypt crypt, int port, boolean isRTP)
          Creates a new EncryptedRTPSocket bound to the specified port
 
Method Summary
 void receive(java.net.DatagramPacket p)
           
 void send(java.net.DatagramPacket p)
           
 void setEncryption(RTPCrypt crypt)
          Sets the current encryption on the socket
 
Methods inherited from class java.net.MulticastSocket
getInterface, getLoopbackMode, getNetworkInterface, getTimeToLive, getTTL, joinGroup, joinGroup, leaveGroup, leaveGroup, send, setInterface, setLoopbackMode, setNetworkInterface, setTimeToLive, setTTL
 
Methods inherited from class java.net.DatagramSocket
bind, close, connect, connect, disconnect, getBroadcast, getChannel, getInetAddress, getLocalAddress, getLocalPort, getLocalSocketAddress, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoTimeout, getTrafficClass, isBound, isClosed, isConnected, setBroadcast, setDatagramSocketImplFactory, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSoTimeout, setTrafficClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptedRTPSocket

public EncryptedRTPSocket(RTPCrypt crypt,
                          int port)
                   throws java.io.IOException
Creates a new EncryptedRTPSocket bound to the specified port

Parameters:
crypt - The encryption or null for none
port - The port to bind to (RTP if even, RTCP if odd)
Throws:
java.io.IOException

EncryptedRTPSocket

public EncryptedRTPSocket(RTPCrypt crypt,
                          java.net.InetAddress addr,
                          int port,
                          boolean isRTP)
                   throws java.io.IOException
Creates a new EncryptedRTPSocket bound to the specified port

Parameters:
crypt - The encryption or null for none
port - The port to bind to (RTP if even, RTCP if odd)
isRTP - True if the port is RTP, false if it is RTCP
Throws:
java.io.IOException

EncryptedRTPSocket

public EncryptedRTPSocket(RTPCrypt crypt,
                          java.net.InetAddress addr,
                          int port)
                   throws java.io.IOException
Creates a new EncryptedRTPSocket bound to the specified port

Parameters:
crypt - The encryption or null for none
port - The port to bind to (RTP if even, RTCP if odd)
Throws:
java.io.IOException

EncryptedRTPSocket

public EncryptedRTPSocket(RTPCrypt crypt,
                          int port,
                          boolean isRTP)
                   throws java.io.IOException
Creates a new EncryptedRTPSocket bound to the specified port

Parameters:
crypt - The encryption or null for none
port - The port to bind to (RTP if even, RTCP if odd)
isRTP - True if the port is RTP, false if it is RTCP
Throws:
java.io.IOException
Method Detail

send

public void send(java.net.DatagramPacket p)
          throws java.io.IOException
Overrides:
send in class java.net.DatagramSocket
Throws:
java.io.IOException
See Also:
DatagramSocket.send(java.net.DatagramPacket)

receive

public void receive(java.net.DatagramPacket p)
             throws java.io.IOException
Overrides:
receive in class java.net.DatagramSocket
Throws:
java.io.IOException
See Also:
DatagramSocket.receive(java.net.DatagramPacket)

setEncryption

public void setEncryption(RTPCrypt crypt)
Sets the current encryption on the socket

Parameters:
crypt - The encryption algorithm, or null for none