|
Openfire 3.4.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.openfire.mediaproxy.DynamicAddressChannel
public class DynamicAddressChannel
Listen packets from defined dataSocket and send packets to the defined host. But also provides a mechanism to dynamic bind host and port implementing DatagramListener methods to change the host and port values according to the received packets.
Field Summary | |
---|---|
protected byte[] |
buf
|
protected DatagramSocket |
dataSocket
|
protected boolean |
enabled
|
protected InetAddress |
host
|
protected DatagramPacket |
packet
|
protected int |
port
|
Constructor Summary | |
---|---|
DynamicAddressChannel(DatagramSocket dataSocket,
InetAddress host,
int port)
Default Channel Constructor |
Method Summary | |
---|---|
void |
addListener(DatagramListener datagramListener)
Adds a DatagramListener to the Channel |
void |
cancel()
|
boolean |
datagramReceived(DatagramPacket datagramPacket)
Implement DatagramListener method. |
InetAddress |
getHost()
Get the host that the packet will be sent to. |
int |
getPort()
Get the port that the packet will be sent to. |
void |
relayPacket(DatagramPacket packet)
|
void |
removeListener(DatagramListener datagramListener)
Remove a DatagramListener from the Channel |
void |
removeListeners()
Remove every Listeners |
void |
run()
Thread override method |
protected void |
setHost(InetAddress host)
Set the host that the packet will be sent to. |
protected void |
setPort(int port)
Set the port that the packet will be sent to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
---|
run |
Field Detail |
---|
protected byte[] buf
protected DatagramSocket dataSocket
protected DatagramPacket packet
protected boolean enabled
protected InetAddress host
protected int port
Constructor Detail |
---|
public DynamicAddressChannel(DatagramSocket dataSocket, InetAddress host, int port)
dataSocket
- datasocket to used to send and receive packetshost
- default destination host for received packetsport
- default destination port for received packetsMethod Detail |
---|
public boolean datagramReceived(DatagramPacket datagramPacket)
datagramReceived
in interface DatagramListener
datagramPacket
- the received packet
public InetAddress getHost()
protected void setHost(InetAddress host)
public int getPort()
protected void setPort(int port)
port
- public void addListener(DatagramListener datagramListener)
datagramListener
- public void removeListener(DatagramListener datagramListener)
datagramListener
- public void removeListeners()
public void cancel()
public void run()
run
in interface Runnable
public void relayPacket(DatagramPacket packet)
|
Openfire 3.4.3 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |