Package org.red5.client.net.rtmpt
Class RTMPTClientConnector
- java.lang.Object
-
- java.lang.Thread
-
- org.red5.client.net.rtmpt.RTMPTClientConnector
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
RTMPTSClientConnector
public class RTMPTClientConnector extends Thread
Client connector for RTMPT- Author:
- Anton Lebedevich (mabrek@gmail.com), Paul Gregoire (mondain@gmail.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected RTMPTClientclientprotected static StringCONTENT_TYPEprotected org.apache.http.client.HttpClienthttpClientprotected longmessageCountprotected static intSEND_TARGET_SIZESize to split messages queue by, borrowed from RTMPTServlet.RESPONSE_TARGET_SIZEprotected StringsessionIdprotected booleanstopRequestedprotected org.apache.http.HttpHosttargetHostprotected static org.apache.http.entity.ByteArrayEntityZERO_REQUEST_ENTITY-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRTMPTClientConnector()RTMPTClientConnector(String server, int port, RTMPTClient client)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static voidcheckResponseCode(org.apache.http.HttpResponse response)protected voidfinalizeConnection()protected static org.apache.http.client.methods.HttpPostgetPost(String uri)StringgetSessionId()protected org.apache.http.client.methods.HttpPostmakePost(String command)protected StringmakeUrl(String command)voidrun()protected static voidsetCommonHeaders(org.apache.http.client.methods.HttpPost post)voidsetStopRequested(boolean stopRequested)-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
CONTENT_TYPE
protected static final String CONTENT_TYPE
- See Also:
- Constant Field Values
-
ZERO_REQUEST_ENTITY
protected static final org.apache.http.entity.ByteArrayEntity ZERO_REQUEST_ENTITY
-
SEND_TARGET_SIZE
protected static final int SEND_TARGET_SIZE
Size to split messages queue by, borrowed from RTMPTServlet.RESPONSE_TARGET_SIZE- See Also:
- Constant Field Values
-
httpClient
protected org.apache.http.client.HttpClient httpClient
-
targetHost
protected org.apache.http.HttpHost targetHost
-
client
protected RTMPTClient client
-
sessionId
protected String sessionId
-
messageCount
protected long messageCount
-
stopRequested
protected volatile boolean stopRequested
-
-
Constructor Detail
-
RTMPTClientConnector
protected RTMPTClientConnector()
-
RTMPTClientConnector
public RTMPTClientConnector(String server, int port, RTMPTClient client)
-
-
Method Detail
-
getSessionId
public String getSessionId()
- Returns:
- the sessionId
-
finalizeConnection
protected void finalizeConnection() throws IOException- Throws:
IOException
-
getPost
protected static org.apache.http.client.methods.HttpPost getPost(String uri)
-
makePost
protected org.apache.http.client.methods.HttpPost makePost(String command)
-
setCommonHeaders
protected static void setCommonHeaders(org.apache.http.client.methods.HttpPost post)
-
checkResponseCode
protected static void checkResponseCode(org.apache.http.HttpResponse response) throws org.apache.http.ParseException, IOException- Throws:
org.apache.http.ParseExceptionIOException
-
setStopRequested
public void setStopRequested(boolean stopRequested)
-
-