-
- All Implemented Interfaces:
-
java.lang.Runnable
public class TCPSocketManager extends Thread
-
-
Field Summary
Fields Modifier and Type Field Description private InetSocketAddressserverAddresspublic Stringdomainpublic booleanrunningForMedia
-
Constructor Summary
Constructors Constructor Description TCPSocketManager(ServerMessageProcessor processor, ProtocolInfo protocolInfo, String domain, ByteArray header, int addedPort)
-
Method Summary
Modifier and Type Method Description InetSocketAddressgetServerAddress()return the server address it is communicating voidrun()Periodically check if any receiver thread has shutted down. booleansendMessage(Array<byte> data, int offset, int len)try to send this message using any of the available receivers voidprocessReceivedMessgage(ByteArray signalReceiveBuffer)voidshutdown()booleansendMessage(ByteArray message)booleanisRunning()voidsetInfo(ProtocolInfo protocolInfo, int addedPort, String domain, ByteArray header)When prov resolved and some parameter is changed about signaling server.Then this tcp socket manager need to change it's socket too. -
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, start, stop, suspend, toString, yield -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
TCPSocketManager
TCPSocketManager(ServerMessageProcessor processor, ProtocolInfo protocolInfo, String domain, ByteArray header, int addedPort)
-
-
Method Detail
-
getServerAddress
InetSocketAddress getServerAddress()
return the server address it is communicating
-
run
void run()
Periodically check if any receiver thread has shutted down. then create a new one
-
sendMessage
boolean sendMessage(Array<byte> data, int offset, int len)
try to send this message using any of the available receivers
-
processReceivedMessgage
void processReceivedMessgage(ByteArray signalReceiveBuffer)
-
shutdown
void shutdown()
-
sendMessage
boolean sendMessage(ByteArray message)
-
isRunning
boolean isRunning()
-
setInfo
void setInfo(ProtocolInfo protocolInfo, int addedPort, String domain, ByteArray header)
When prov resolved and some parameter is changed about signaling server.Then this tcp socket manager need to change it's socket too. This method is aimed to do that
- Parameters:
protocolInfo- is the new protocol info for this manager.domain- is the new domain for this manager.header- is the new header ByteArray for this manager.
-
-
-
-