Class HttpSocketImpl

  • All Implemented Interfaces:
    HttpSocket

    public class HttpSocketImpl
    extends java.lang.Object
    implements HttpSocket
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<java.lang.Void> close()  
      java.util.concurrent.CompletableFuture<java.lang.Void> connect​(java.net.InetSocketAddress addr)  
      boolean isClosed()  
      java.util.concurrent.CompletableFuture<HttpFullResponse> send​(HttpFullRequest request)
      This can be used ONLY if 'you' know that the far end does NOT sended a chunked download.
      HttpStreamRef send​(org.webpieces.httpparser.api.dto.HttpRequest request, HttpResponseListener listener)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HttpSocketImpl

        public HttpSocketImpl​(ChannelProxy channel,
                              org.webpieces.httpparser.api.HttpParser parser,
                              HttpSocketListener socketListener,
                              boolean isHttps)
    • Method Detail

      • connect

        public java.util.concurrent.CompletableFuture<java.lang.Void> connect​(java.net.InetSocketAddress addr)
        Specified by:
        connect in interface HttpSocket
      • send

        public java.util.concurrent.CompletableFuture<HttpFullResponse> send​(HttpFullRequest request)
        Description copied from interface: HttpSocket
        This can be used ONLY if 'you' know that the far end does NOT sended a chunked download. The reason is in a chunked download, we don't want to blow up your RAM. Some apis like twitters streaming api and we would never ever be done and have a full response. Others are just a very very large download you don't want existing in RAM anyways.
        Specified by:
        send in interface HttpSocket
      • close

        public java.util.concurrent.CompletableFuture<java.lang.Void> close()
        Specified by:
        close in interface HttpSocket
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object