org.apache.http.impl

## Class SocketHttpServerConnection

- java.lang.Object
- - org.apache.http.impl.AbstractHttpServerConnection
  - - org.apache.http.impl.SocketHttpServerConnection

- All Implemented Interfaces:
    Closeable, AutoCloseable, HttpConnection, HttpInetConnection, HttpServerConnection
  Direct Known Subclasses:
    DefaultHttpServerConnection

  Deprecated.

      @Deprecated
      public class SocketHttpServerConnection
      extends AbstractHttpServerConnection
      implements HttpInetConnection

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SocketHttpServerConnection()` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `assertNotOpen()` Deprecated.
    `protected void` | `assertOpen()` Deprecated. Asserts if the connection is open.
    `protected void` | `bind(Socket socket, HttpParams params)` Deprecated. Binds this connection to the given `Socket`.
    `void` | `close()` Deprecated. Closes this connection gracefully.
    `protected SessionInputBuffer` | `createSessionInputBuffer(Socket socket, int buffersize, HttpParams params)` Deprecated. Creates an instance of `SocketInputBuffer` to be used for receiving data from the given `Socket`.
    `protected SessionOutputBuffer` | `createSessionOutputBuffer(Socket socket, int buffersize, HttpParams params)` Deprecated. Creates an instance of `SessionOutputBuffer` to be used for sending data to the given `Socket`.
    `InetAddress` | `getLocalAddress()` Deprecated.
    `int` | `getLocalPort()` Deprecated.
    `InetAddress` | `getRemoteAddress()` Deprecated.
    `int` | `getRemotePort()` Deprecated.
    `protected Socket` | `getSocket()` Deprecated.
    `int` | `getSocketTimeout()` Deprecated. Returns the socket timeout value.
    `boolean` | `isOpen()` Deprecated. Checks if this connection is open.
    `void` | `setSocketTimeout(int timeout)` Deprecated. Sets the socket timeout value.
    `void` | `shutdown()` Deprecated. Force-closes this connection.
    `String` | `toString()` Deprecated.

    - ### Methods inherited from class org.apache.http.impl.AbstractHttpServerConnection

      `createConnectionMetrics, createEntityDeserializer, createEntitySerializer, createHttpRequestFactory, createRequestParser, createResponseWriter, doFlush, flush, getMetrics, init, isEof, isStale, receiveRequestEntity, receiveRequestHeader, sendResponseEntity, sendResponseHeader`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.http.HttpConnection

      `getMetrics, isStale`

- - ### Constructor Detail

    - #### SocketHttpServerConnection

          public SocketHttpServerConnection()

      Deprecated.

  - ### Method Detail

    - #### assertNotOpen

          protected void assertNotOpen()

      Deprecated.

    - #### assertOpen

          protected void assertOpen()

      Deprecated.
      Description copied from class: `AbstractHttpServerConnection`
      Asserts if the connection is open.
      Specified by:
        `assertOpen` in class `AbstractHttpServerConnection`

    - #### createSessionInputBuffer

          protected SessionInputBuffer createSessionInputBuffer(Socket socket,
                                                    int buffersize,
                                                    HttpParams params)
                                                         throws IOException

      Deprecated.
      Creates an instance of `SocketInputBuffer` to be used for receiving data from the given `Socket`.

      This method can be overridden in a super class in order to provide a custom implementation of `SessionInputBuffer` interface.

      Parameters:
        `socket` - the socket.
        `buffersize` - the buffer size.
        `params` - HTTP parameters.
      Returns:
        session input buffer.
      Throws:
        `IOException` - in case of an I/O error.
      See Also:
        `SocketInputBuffer.SocketInputBuffer(Socket, int, HttpParams)`

    - #### createSessionOutputBuffer

          protected SessionOutputBuffer createSessionOutputBuffer(Socket socket,
                                                      int buffersize,
                                                      HttpParams params)
                                                           throws IOException

      Deprecated.
      Creates an instance of `SessionOutputBuffer` to be used for sending data to the given `Socket`.

      This method can be overridden in a super class in order to provide a custom implementation of `SocketOutputBuffer` interface.

      Parameters:
        `socket` - the socket.
        `buffersize` - the buffer size.
        `params` - HTTP parameters.
      Returns:
        session output buffer.
      Throws:
        `IOException` - in case of an I/O error.
      See Also:
        `SocketOutputBuffer.SocketOutputBuffer(Socket, int, HttpParams)`

    - #### bind

          protected void bind(Socket socket,
                  HttpParams params)
                       throws IOException

      Deprecated.
      Binds this connection to the given `Socket`. This socket will be used by the connection to send and receive data.

      This method will invoke `createSessionInputBuffer(Socket, int, HttpParams)` and `createSessionOutputBuffer(Socket, int, HttpParams)` methods to create session input / output buffers bound to this socket and then will invoke `AbstractHttpServerConnection.init(SessionInputBuffer, SessionOutputBuffer, HttpParams)` method to pass references to those buffers to the underlying HTTP message parser and formatter.

      After this method's execution the connection status will be reported as open and the `isOpen()` will return `true`.

      Parameters:
        `socket` - the socket.
        `params` - HTTP parameters.
      Throws:
        `IOException` - in case of an I/O error.

    - #### getSocket

          protected Socket getSocket()

      Deprecated.

    - #### isOpen

          public boolean isOpen()

      Deprecated.
      Description copied from interface: `HttpConnection`
      Checks if this connection is open.
      Specified by:
        `isOpen` in interface `HttpConnection`
      Returns:
        true if it is open, false if it is closed.

    - #### getLocalAddress

          public InetAddress getLocalAddress()

      Deprecated.
      Specified by:
        `getLocalAddress` in interface `HttpInetConnection`

    - #### getLocalPort

          public int getLocalPort()

      Deprecated.
      Specified by:
        `getLocalPort` in interface `HttpInetConnection`

    - #### getRemoteAddress

          public InetAddress getRemoteAddress()

      Deprecated.
      Specified by:
        `getRemoteAddress` in interface `HttpInetConnection`

    - #### getRemotePort

          public int getRemotePort()

      Deprecated.
      Specified by:
        `getRemotePort` in interface `HttpInetConnection`

    - #### setSocketTimeout

          public void setSocketTimeout(int timeout)

      Deprecated.
      Description copied from interface: `HttpConnection`
      Sets the socket timeout value.
      Specified by:
        `setSocketTimeout` in interface `HttpConnection`
      Parameters:
        `timeout` - timeout value in milliseconds

    - #### getSocketTimeout

          public int getSocketTimeout()

      Deprecated.
      Description copied from interface: `HttpConnection`
      Returns the socket timeout value.
      Specified by:
        `getSocketTimeout` in interface `HttpConnection`
      Returns:
        positive value in milliseconds if a timeout is set, `0` if timeout is disabled or `-1` if timeout is undefined.

    - #### shutdown

          public void shutdown()
                        throws IOException

      Deprecated.
      Description copied from interface: `HttpConnection`
      Force-closes this connection. This is the only method of a connection which may be called from a different thread to terminate the connection. This method will not attempt to flush the transmitter's internal buffer prior to closing the underlying socket.
      Specified by:
        `shutdown` in interface `HttpConnection`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Deprecated.
      Description copied from interface: `HttpConnection`
      Closes this connection gracefully. This method will attempt to flush the internal output buffer prior to closing the underlying socket. This method MUST NOT be called from a different thread to force shutdown of the connection. Use `shutdown` instead.
      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `HttpConnection`
      Throws:
        `IOException`

    - #### toString

          public String toString()

      Deprecated.
      Overrides:
        `toString` in class `Object`

Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.