\doxysection{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+http.\+Http\+Server Class Reference}
\hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer}{}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer}\index{com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}}
Inheritance diagram for com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+http.\+Http\+Server\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer}
\end{center}
\end{figure}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a49b3f454c3a6eaf63073671220e1e0e1}{Http\+Server}} ()
\begin{DoxyCompactList}\small\item\em Constructs a HTTP Server that streams the data from the given provider. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_aba953ceaa4074ade111f995bebd32b9d}{bind\+And\+Listen}} (final int port)
\item 
\Hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a27484cc714ab708b0ae277993edbbe52}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a27484cc714ab708b0ae277993edbbe52} 
void {\bfseries clean\+Up\+Connected\+Socket} ()
\item 
\Hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a7b218241d41b8ff071aa7c3de63a93d9}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a7b218241d41b8ff071aa7c3de63a93d9} 
void {\bfseries clean\+Up\+Listening\+Socket} ()
\item 
URI \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a69fb87674363832a4271f4f171c7b885}{get\+Uri}} ()
\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a5207840b582b7c4cc9fc3668b43766b5}{set\+Data\+Provider}} (Data\+Provider raw\+Packet\+Provider)
\begin{DoxyCompactList}\small\item\em Sets the HTTP Server to streams the data from the given provider. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server}{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+Server}}}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_ae8db3873d9eb41d642b7e1e695e38bfc}{listen}} (int port)
\begin{DoxyCompactList}\small\item\em Starts listening and accepting connections on the given port. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_aa7a7241d0ac7c44f2faeade1d2779b9f}{stop}} ()
\begin{DoxyCompactList}\small\item\em Stops the server. \end{DoxyCompactList}\item 
boolean \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a5d97bdce69a5aa3a79c7393bcf85215f}{block\+Until\+Ready}} ()
\item 
void {\bfseries stop\+Blocking\+Until\+Ready} ()
\begin{DoxyCompactList}\small\item\em Unblock the thread waiting on a call to block\+Until\+Ready. \end{DoxyCompactList}\item 
void {\bfseries set\+State\+Changed\+Listener} (\mbox{\hyperlink{interfacecom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_1_1StateChangedListener}{State\+Changed\+Listener}} state\+Changed\+Listener)
\begin{DoxyCompactList}\small\item\em Sets the listener to be notified about the various state change on the server. \end{DoxyCompactList}\item 
\mbox{\hyperlink{enumcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_1_1State}{State}} {\bfseries get\+State} ()
\begin{DoxyCompactList}\small\item\em Gets the current state of the server. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a92d97df4f0406bddc615225745afd7f3}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a92d97df4f0406bddc615225745afd7f3} 
static final String {\bfseries SERVER\+\_\+\+NAME} = "{}Triton Digital HTTP Proxy"{}
\end{DoxyCompactItemize}
\doxysubsubsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a8be4244ef434a1e8d23203370ae791c8}{disconnect\+And\+Unbind}} ()
\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a04416e79b5ef9c7e4afafac16a8a42ea}{on\+Process\+Message}} (Object user\+Info)
\end{DoxyCompactItemize}
\doxysubsection*{Protected Member Functions inherited from \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server}{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+Server}}}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a885045fad07e6c0720f915a4ebaa24b4}{on\+Connected}} ()
\begin{DoxyCompactList}\small\item\em Called when the child class accepts a connection. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a8ab3706180ba9430b836221ee03a2efa}{on\+Disconnected}} ()
\begin{DoxyCompactList}\small\item\em Called when the child class disconnected. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a563494b875cba3c8cec7da487227db0e}{on\+Error}} (Error\+Detail error\+Detail)
\begin{DoxyCompactList}\small\item\em Called when the child class encounters an error. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a8dfcd48c3da623f89c41b3da190685b8}{on\+Message\+Received}} (Object user\+Info)
\begin{DoxyCompactList}\small\item\em Called when the child class receives data. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a0e9cba38c009f83f1e1112d3e157f49f}{set\+State\+Not\+Ready}} ()
\begin{DoxyCompactList}\small\item\em Sets the internal state to not ready state and notify listener about it. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_ad4566ec1b00a1bde8a343bc71e723dd4}{set\+State\+Ready}} ()
\begin{DoxyCompactList}\small\item\em Sets the internal state to ready state and notify listener about it. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a4f705f88274c5619a98bd56eb1fcd701}{set\+State\+Listening}} ()
\begin{DoxyCompactList}\small\item\em Sets the internal state to listening state and notify listener about it. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a6435d16c082d6518f11473720e2eb44f}{set\+State\+Connected}} ()
\begin{DoxyCompactList}\small\item\em Sets the internal state to connected state and notify listener about it. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_ab156a0ada638e89f94d35f457ba1a252}{set\+State\+Stopping}} ()
\begin{DoxyCompactList}\small\item\em Sets the internal state to stopping state and notify listener about it. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a272fe8f787f6f7e50551245c26b2cb55}{set\+State\+Error}} (Error\+Detail error\+Detail)
\begin{DoxyCompactList}\small\item\em Sets the internal state to error state and notify listener about it. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Additional Inherited Members}
\doxysubsection*{Public Attributes inherited from \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server}{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+Server}}}
\begin{DoxyCompactItemize}
\item 
final String {\bfseries TAG} = "{}Server"{}
\end{DoxyCompactItemize}
\doxysubsection*{Static Protected Attributes inherited from \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server}{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+Server}}}
\begin{DoxyCompactItemize}
\item 
static final String {\bfseries LOCALHOST} = "{}127.\+0.\+0.\+1"{}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Implementation of a Server that responds to Http requests. The Server uses a socket to listen and negotiate the connection. It then streams using the already established TCP connection in response to an HTTP GET request.

The server listens and accepts a connection, the uses non-\/blocking sockets to read the requests. To be able to use a Buffered\+Reader, the data that is read from the non-\/blocking socket is pushed in the Queue\+Input\+Stream, on which the Buffered\+Reader reads. The read blocks until new data is read from the socket and pushed in the Queue\+Input\+Stream. This adds a new thread, but it simplifies the code and allows interrupting the reads, which a blocking socket does not.

Streaming works by having a background thread that continuously loops and get a packet from the packet provider and send this packet using the appropriate transport. If there are no packet ready, the thread blocks due to the provider blocking until a packet is available.

Therefore, this server uses 3 threads. One for the server (accept the connection, read from the non-\/blocking socket and push the new data in the Queue\+Input\+Stream), one for the Http Request Reception (reads from the Queue\+Input\+Stream, process the received request and blocks when no more data to read) and one for the Audio packets transfer (blocks when no packets available). 

\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a49b3f454c3a6eaf63073671220e1e0e1}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a49b3f454c3a6eaf63073671220e1e0e1} 
\index{com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}!HttpServer@{HttpServer}}
\index{HttpServer@{HttpServer}!com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}}
\doxysubsubsection{\texorpdfstring{HttpServer()}{HttpServer()}}
{\footnotesize\ttfamily com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+http.\+Http\+Server.\+Http\+Server (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Constructs a HTTP Server that streams the data from the given provider. 

The new instance needs to have a source set ({\ttfamily set\+Data\+Provider}) before it starts listening. Use {\ttfamily block\+Until\+Ready} before starting to listen to avoid delays in responses. 

\doxysubsection{Member Function Documentation}
\Hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_aba953ceaa4074ade111f995bebd32b9d}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_aba953ceaa4074ade111f995bebd32b9d} 
\index{com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}!bindAndListen@{bindAndListen}}
\index{bindAndListen@{bindAndListen}!com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}}
\doxysubsubsection{\texorpdfstring{bindAndListen()}{bindAndListen()}}
{\footnotesize\ttfamily void com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+http.\+Http\+Server.\+bind\+And\+Listen (\begin{DoxyParamCaption}\item[{final int}]{port }\end{DoxyParamCaption})}



Reimplemented from \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_ace2fc1d27ef8854d9c87d099201fd612}{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+Server}}.

\Hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a8be4244ef434a1e8d23203370ae791c8}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a8be4244ef434a1e8d23203370ae791c8} 
\index{com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}!disconnectAndUnbind@{disconnectAndUnbind}}
\index{disconnectAndUnbind@{disconnectAndUnbind}!com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}}
\doxysubsubsection{\texorpdfstring{disconnectAndUnbind()}{disconnectAndUnbind()}}
{\footnotesize\ttfamily void com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+http.\+Http\+Server.\+disconnect\+And\+Unbind (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}



Reimplemented from \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_ac579f5c27926d9d59df1f3ee29a629b5}{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+Server}}.

\Hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a69fb87674363832a4271f4f171c7b885}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a69fb87674363832a4271f4f171c7b885} 
\index{com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}!getUri@{getUri}}
\index{getUri@{getUri}!com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}}
\doxysubsubsection{\texorpdfstring{getUri()}{getUri()}}
{\footnotesize\ttfamily URI com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+http.\+Http\+Server.\+get\+Uri (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Reimplemented from \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a2b270c42292328ae5289ccc529214812}{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+Server}}.

\Hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a04416e79b5ef9c7e4afafac16a8a42ea}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a04416e79b5ef9c7e4afafac16a8a42ea} 
\index{com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}!onProcessMessage@{onProcessMessage}}
\index{onProcessMessage@{onProcessMessage}!com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}}
\doxysubsubsection{\texorpdfstring{onProcessMessage()}{onProcessMessage()}}
{\footnotesize\ttfamily void com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+http.\+Http\+Server.\+on\+Process\+Message (\begin{DoxyParamCaption}\item[{Object}]{user\+Info }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [protected]}}



Reimplemented from \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_ae11a46d44d621fdf7aa356c0fa0d6ff9}{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+Server}}.

\Hypertarget{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a5207840b582b7c4cc9fc3668b43766b5}\label{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1http_1_1HttpServer_a5207840b582b7c4cc9fc3668b43766b5} 
\index{com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}!setDataProvider@{setDataProvider}}
\index{setDataProvider@{setDataProvider}!com.tritondigital.net.streaming.proxy.server.http.HttpServer@{com.tritondigital.net.streaming.proxy.server.http.HttpServer}}
\doxysubsubsection{\texorpdfstring{setDataProvider()}{setDataProvider()}}
{\footnotesize\ttfamily void com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+http.\+Http\+Server.\+set\+Data\+Provider (\begin{DoxyParamCaption}\item[{Data\+Provider}]{raw\+Packet\+Provider }\end{DoxyParamCaption})}



Sets the HTTP Server to streams the data from the given provider. 

Ignored if the server is already listening or connected. Use {\ttfamily block\+Until\+Ready} or wait for the on\+Server\+Ready notification after the provider changes and before starting to listen to avoid delays in responses.


\begin{DoxyParams}{Parameters}
{\em raw\+Packet\+Provider} & Source of the packets to transmit. \\
\hline
\end{DoxyParams}


Reimplemented from \mbox{\hyperlink{classcom_1_1tritondigital_1_1net_1_1streaming_1_1proxy_1_1server_1_1Server_a197ffbd6fcd89d42d9f35488cc5b91b2}{com.\+tritondigital.\+net.\+streaming.\+proxy.\+server.\+Server}}.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
sdk/src/main/java/com/tritondigital/net/streaming/proxy/server/http/Http\+Server.\+java\end{DoxyCompactItemize}
