public class RTMPTServlet
extends javax.servlet.http.HttpServlet
Modifier and Type | Field and Description |
---|---|
protected org.springframework.web.context.WebApplicationContext |
appCtx
Web app context
|
protected static org.slf4j.Logger |
log
Logger
|
Constructor and Description |
---|
RTMPTServlet() |
Modifier and Type | Method and Description |
---|---|
protected RTMPTConnection |
createConnection() |
void |
destroy() |
protected RTMPTConnection |
getClientConnection(javax.servlet.http.HttpServletRequest req)
Get the RTMPT client for a session.
|
protected Integer |
getClientId(javax.servlet.http.HttpServletRequest req)
Return the client id from a url like /send/123456/12 -> 123456
|
protected RTMPTConnection |
getConnection(int clientId) |
protected void |
handleBadRequest(String message,
javax.servlet.http.HttpServletResponse resp)
Return an error message to the client.
|
protected void |
handleClose(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Close a RTMPT session.
|
protected void |
handleIdle(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Poll RTMPT session for updates.
|
protected void |
handleOpen(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Start a new RTMPT session.
|
protected void |
handleSend(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Add data for an established session.
|
void |
init() |
boolean |
isEnforceContentTypeCheck() |
protected void |
notifyClosed(RTMPTConnection conn)
A connection has been closed that was created by this servlet.
|
protected void |
removeConnection(int clientId) |
protected void |
returnMessage(byte message,
javax.servlet.http.HttpServletResponse resp)
Return a single byte to the client.
|
protected void |
returnMessage(RTMPTConnection client,
IoBuffer buffer,
javax.servlet.http.HttpServletResponse resp)
Return raw data to the client.
|
protected void |
returnMessage(String message,
javax.servlet.http.HttpServletResponse resp)
Return a message to the client.
|
protected void |
returnPendingMessages(RTMPTConnection client,
javax.servlet.http.HttpServletResponse resp)
Send pending messages to client.
|
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Main entry point for the servlet.
|
void |
setEnforceContentTypeCheck(boolean enforceContentTypeCheck) |
void |
setHandler(RTMPTHandler handler)
Set the RTMPTHandler to use in this servlet.
|
void |
setIdent2(String ident2)
Set the fcs/ident2 string
|
void |
setRtmpConnManager(IRTMPConnManager rtmpConnManager) |
void |
setTargetResponseSize(int targetResponseSize)
Sets the target size for responses
|
protected void |
skipData(javax.servlet.http.HttpServletRequest req)
Skip data sent by the client.
|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
protected static org.slf4j.Logger log
protected transient org.springframework.web.context.WebApplicationContext appCtx
public void setRtmpConnManager(IRTMPConnManager rtmpConnManager)
public void setHandler(RTMPTHandler handler)
handler
- handlerpublic void setIdent2(String ident2)
ident2
- public void setTargetResponseSize(int targetResponseSize)
targetResponseSize
- the targetResponseSize to setprotected void handleBadRequest(String message, javax.servlet.http.HttpServletResponse resp) throws IOException
message
- Messageresp
- Servlet responseIOException
- I/O exceptionprotected void returnMessage(byte message, javax.servlet.http.HttpServletResponse resp) throws IOException
message
- Messageresp
- Servlet responseIOException
- I/O exceptionprotected void returnMessage(String message, javax.servlet.http.HttpServletResponse resp) throws IOException
message
- Messageresp
- Servlet responseIOException
- I/O exceptionprotected void returnMessage(RTMPTConnection client, IoBuffer buffer, javax.servlet.http.HttpServletResponse resp) throws IOException
client
- RTMP connectionbuffer
- Raw data as byte bufferresp
- Servlet responseIOException
- I/O exceptionprotected Integer getClientId(javax.servlet.http.HttpServletRequest req)
req
- Servlet requestprotected RTMPTConnection getClientConnection(javax.servlet.http.HttpServletRequest req)
req
- Servlet requestprotected void skipData(javax.servlet.http.HttpServletRequest req) throws IOException
req
- Servlet requestIOException
- I/O exceptionprotected void returnPendingMessages(RTMPTConnection client, javax.servlet.http.HttpServletResponse resp) throws IOException
client
- RTMP connectionresp
- Servlet responseIOException
- I/O exceptionprotected void handleOpen(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
req
- Servlet requestresp
- Servlet responsejavax.servlet.ServletException
- Servlet exceptionIOException
- I/O exceptionprotected void handleClose(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
req
- Servlet requestresp
- Servlet responsejavax.servlet.ServletException
- Servlet exceptionIOException
- I/O exceptionprotected void handleSend(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
req
- Servlet requestresp
- Servlet responsejavax.servlet.ServletException
- Servlet exceptionIOException
- I/O exceptionprotected void handleIdle(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
req
- Servlet requestresp
- Servlet responsejavax.servlet.ServletException
- Servlet exceptionIOException
- I/O exceptionprotected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
service
in class javax.servlet.http.HttpServlet
req
- Request objectresp
- Response objectjavax.servlet.ServletException
IOException
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
protected void notifyClosed(RTMPTConnection conn)
conn
- protected RTMPTConnection getConnection(int clientId)
protected RTMPTConnection createConnection()
protected void removeConnection(int clientId)
public boolean isEnforceContentTypeCheck()
public void setEnforceContentTypeCheck(boolean enforceContentTypeCheck)
enforceContentTypeCheck
- the enforceContentTypeCheck to setCopyright © 2006-2012 The Red5 Project