org.mule.transport.http
Class HttpServerConnection

java.lang.Object
  extended by org.mule.transport.http.HttpServerConnection

public class HttpServerConnection
extends Object

A connection to the SimpleHttpServer.


Constructor Summary
HttpServerConnection(Socket socket, String encoding, HttpConnector connector)
           
 
Method Summary
 void close()
           
 InputStream getInputStream()
           
 OutputStream getOutputStream()
           
 int getSocketReceiveBufferSize()
          Gets the value of the SO_RCVBUF for the underlying socket.
 int getSocketTimeout()
          Returns the value of the SO_TIMEOUT for the underlying socket.
 ResponseWriter getWriter()
          Returns the ResponseWriter used to write the output to the socket.
 boolean isKeepAlive()
           
 boolean isOpen()
           
 boolean isSocketKeepAlive()
          Tests if SO_KEEPALIVE is enabled in the underlying socket.
 boolean isSocketTcpNoDelay()
          Tests if TCP_NODELAY is enabled in the underlying socket.
 HttpRequest readRequest()
           
 HttpResponse readResponse()
           
 void setKeepAlive(boolean b)
           
 void setSocketTimeout(int timeout)
           
 void writeRequest(HttpRequest request)
           
 void writeResponse(HttpResponse response)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpServerConnection

public HttpServerConnection(Socket socket,
                            String encoding,
                            HttpConnector connector)
                     throws IOException
Throws:
IOException
Method Detail

close

public void close()

isOpen

public boolean isOpen()

setKeepAlive

public void setKeepAlive(boolean b)

isKeepAlive

public boolean isKeepAlive()

getInputStream

public InputStream getInputStream()

getOutputStream

public OutputStream getOutputStream()

getWriter

public ResponseWriter getWriter()
                         throws UnsupportedEncodingException
Returns the ResponseWriter used to write the output to the socket.

Returns:
This connection's ResponseWriter
Throws:
UnsupportedEncodingException

readRequest

public HttpRequest readRequest()
                        throws IOException
Throws:
IOException

readResponse

public HttpResponse readResponse()
                          throws IOException
Throws:
IOException

writeRequest

public void writeRequest(HttpRequest request)
                  throws IOException
Throws:
IOException

writeResponse

public void writeResponse(HttpResponse response)
                   throws IOException,
                          TransformerException
Throws:
IOException
TransformerException

getSocketTimeout

public int getSocketTimeout()
                     throws SocketException
Returns the value of the SO_TIMEOUT for the underlying socket.

Returns:
The value of the SO_TIMEOUT for the underlying socket.
Throws:
SocketException - If there is an error in the underlying protocol.

setSocketTimeout

public void setSocketTimeout(int timeout)
                      throws SocketException
Throws:
SocketException

isSocketKeepAlive

public boolean isSocketKeepAlive()
                          throws SocketException
Tests if SO_KEEPALIVE is enabled in the underlying socket.

Returns:
a boolean indicating whether or not SO_KEEPALIVE is enabled.
Throws:
SocketException - If there is an error in the underlying protocol.

isSocketTcpNoDelay

public boolean isSocketTcpNoDelay()
                           throws SocketException
Tests if TCP_NODELAY is enabled in the underlying socket.

Returns:
a boolean indicating whether or not TCP_NODELAY is enabled.
Throws:
SocketException - If there is an error in the underlying protocol.

getSocketReceiveBufferSize

public int getSocketReceiveBufferSize()
                               throws SocketException
Gets the value of the SO_RCVBUF for the underlying socket.

Returns:
The value of the SO_RCVBUF for the underlying socket.
Throws:
SocketException - If there is an error in the underlying protocol.


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.