public abstract class MediaProxySession extends Thread implements ProxyCandidate, DatagramListener
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected org.jivesoftware.openfire.mediaproxy.Channel |
channelAtoB |
protected org.jivesoftware.openfire.mediaproxy.Channel |
channelAtoBControl |
protected org.jivesoftware.openfire.mediaproxy.Channel |
channelBtoA |
protected org.jivesoftware.openfire.mediaproxy.Channel |
channelBtoAControl |
protected InetAddress |
hostA |
protected InetAddress |
hostB |
protected InetAddress |
localAddress |
protected int |
localPortA |
protected int |
localPortB |
protected int |
portA |
protected int |
portB |
protected DatagramSocket |
socketA |
protected DatagramSocket |
socketAControl |
protected DatagramSocket |
socketB |
protected DatagramSocket |
socketBControl |
protected Thread |
threadAtoB |
protected Thread |
threadAtoBControl |
protected Thread |
threadBtoA |
protected Thread |
threadBtoAControl |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
MediaProxySession(String id,
String creator,
String localAddress,
String hostA,
int portA,
String hostB,
int portB,
int minPort,
int maxPort)
Creates a new static UDP channel between Host A and Host B.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAgentListener(SessionListener sessionListener)
Adds a listener for Session events
|
void |
clearAgentListeners()
Removes every Session events listeners
|
boolean |
datagramReceived(DatagramPacket datagramPacket)
Implement DatagramListener to timestamp last packet arrived
|
void |
dispatchAgentStopped()
Dispatch Stop Event
|
String |
getCreator()
Get the agent creator.
|
protected int |
getFreePort()
Obtain a free port with a nested control port we can use.
|
InetAddress |
getHostA()
Get the Host A IP
|
InetAddress |
getHostB()
Get the Host B IP
|
InetAddress |
getLocalhost()
Get localhost of the Session
|
int |
getLocalPortA()
Get the localport that listen for Host A Packets
|
int |
getLocalPortB()
Get the localport that listen for Host B Packets
|
String |
getPass()
Get the pass of this Session
A pass can be used to authorize an Session modification
|
int |
getPortA()
Get the Port A IP
|
int |
getPortB()
Get the Port B IP
|
String |
getSID()
Get the ID of the Session
|
long |
getTimestamp()
Get last packet arrived timestamp
|
void |
removeAgentListener(SessionListener sessionListener)
Removes an Session events listener
|
void |
run()
Thread override method
|
void |
sendFromPortA(String host,
int port) |
void |
sendFromPortB(String host,
int port) |
void |
setHostA(InetAddress hostA)
Set the Host A IP
|
void |
setHostB(InetAddress hostB)
Set the Host B IP
|
void |
setPortA(int portA)
Set port A value
|
void |
setPortB(int portB)
Set port B value
|
void |
stopAgent()
Stop the Session
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitstartprotected InetAddress localAddress
protected InetAddress hostA
protected InetAddress hostB
protected int portA
protected int portB
protected int localPortA
protected int localPortB
protected DatagramSocket socketA
protected DatagramSocket socketAControl
protected DatagramSocket socketB
protected DatagramSocket socketBControl
protected org.jivesoftware.openfire.mediaproxy.Channel channelAtoB
protected org.jivesoftware.openfire.mediaproxy.Channel channelAtoBControl
protected org.jivesoftware.openfire.mediaproxy.Channel channelBtoA
protected org.jivesoftware.openfire.mediaproxy.Channel channelBtoAControl
protected Thread threadAtoB
protected Thread threadAtoBControl
protected Thread threadBtoA
protected Thread threadBtoAControl
public MediaProxySession(String id, String creator, String localAddress, String hostA, int portA, String hostB, int portB, int minPort, int maxPort)
id - of the Session (Could be a Jingle session ID)creator - the session creator name or descriptionlocalAddress - the localhost IP that will listen for UDP packetshostA - the hostname or IP of the point A of the ChannelportA - the port number point A of the ChannelhostB - the hostname or IP of the point B of the ChannelportB - the port number point B of the ChannelminPort - the minimal port value to be used by the servermaxPort - the maximun port value to be used by the serverprotected int getFreePort()
public String getSID()
getSID in interface ProxyCandidatepublic String getPass()
getPass in interface ProxyCandidatepublic String getCreator()
public long getTimestamp()
public void run()
public void stopAgent()
stopAgent in interface ProxyCandidatepublic InetAddress getLocalhost()
getLocalhost in interface ProxyCandidatepublic InetAddress getHostA()
getHostA in interface ProxyCandidatepublic InetAddress getHostB()
getHostB in interface ProxyCandidatepublic void setPortA(int portA)
setPortA in interface ProxyCandidateportA - the port number for Apublic void setPortB(int portB)
setPortB in interface ProxyCandidateportB - the port number for Bpublic void setHostA(InetAddress hostA)
setHostA in interface ProxyCandidatehostA - the host for Apublic void setHostB(InetAddress hostB)
setHostB in interface ProxyCandidatehostB - the host for Bpublic int getPortA()
getPortA in interface ProxyCandidatepublic int getPortB()
getPortB in interface ProxyCandidatepublic int getLocalPortA()
getLocalPortA in interface ProxyCandidatepublic int getLocalPortB()
getLocalPortB in interface ProxyCandidatepublic void sendFromPortA(String host, int port)
sendFromPortA in interface ProxyCandidatepublic void sendFromPortB(String host, int port)
sendFromPortB in interface ProxyCandidatepublic boolean datagramReceived(DatagramPacket datagramPacket)
datagramReceived in interface DatagramListenerdatagramPacket - the datagram packetpublic void addAgentListener(SessionListener sessionListener)
sessionListener - the sessionj listener to addpublic void removeAgentListener(SessionListener sessionListener)
sessionListener - the session listener to removepublic void clearAgentListeners()
public void dispatchAgentStopped()
Copyright © 2003–2020 Ignite Realtime. All rights reserved.