Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAE9817DDE for ; Sun, 29 Mar 2015 14:33:54 +0000 (UTC) Received: (qmail 14880 invoked by uid 500); 29 Mar 2015 14:33:54 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 14831 invoked by uid 500); 29 Mar 2015 14:33:54 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 14817 invoked by uid 99); 29 Mar 2015 14:33:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Mar 2015 14:33:54 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_IMAGE_ONLY_32,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_REMOTE_IMAGE X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mpgallage@gmail.com designates 209.85.216.181 as permitted sender) Received: from [209.85.216.181] (HELO mail-qc0-f181.google.com) (209.85.216.181) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Mar 2015 14:33:29 +0000 Received: by qcbjx9 with SMTP id jx9so52105949qcb.0 for ; Sun, 29 Mar 2015 07:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=y8On35xbXnX5GIYtUjg7C7LKsJhG5yl7tYImN9R2liE=; b=09oNBJo3AmN6Gpx1Bvtx7NE6mEqLJnvh4mrIQ6Oe7iDNR/j7wwTbaqap0abuUrvaVJ qTcM+6BFemxT1L6FsHh37uiaPAwFiwoLzX865DY9/xI/zF4HVm7njtTe3nWFYm9XYGXz 6MBIvPAGfd2XjyWlFPtWoqtHI+i4eD6uNo0q97tOrR8ZRiwERQFOwx4Kfy4/rc1ZEsh7 H7Pvoce3dqZmBEEKmitq1L4v+v/kgsylx7sytq4Dd3Ba9x2gGvTbAZ6Au8RoK4ZsJWEm 5aZ/5fqL7La0j9RQSHVCfP9SH3+H9vFmg8KMqJ2IVVStBG36+mo04DUgayFTD/esQXk+ ou2A== X-Received: by 10.55.22.168 with SMTP id 40mr58145308qkw.101.1427639517738; Sun, 29 Mar 2015 07:31:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.109.230 with HTTP; Sun, 29 Mar 2015 07:31:37 -0700 (PDT) From: Malaka Gallage Date: Sun, 29 Mar 2015 20:01:37 +0530 Message-ID: Subject: Throwing an IO Exception When Client Close the Connection (http-nio4.4) To: HttpComponents Project Content-Type: multipart/alternative; boundary=001a11493f2e5278d705126e3a15 X-Virus-Checked: Checked by ClamAV on apache.org --001a11493f2e5278d705126e3a15 Content-Type: text/plain; charset=UTF-8 Hello everyone, I'm migrating from http-nio 4.2.5 to 4.4 and am having some issue with the following scenario. Some client sends a request and when the server send the response, client has closed the connection. The connection state is FIN_WAIT2 --> CLOSE_WAIT. In 4.2.5 it throws an IO Exception on this scenario but 4.4 does not throw any exception. I tried to debug the code and realized that the problem is, in 4.2.5 it first writes only the response headers and when it tries to write the response body it trows the IO Exception. But in 4.4, it writes the response headers and the payload together and then it can not know the connection is closed. So the exception is not thrown. The major differences are on this method. DefaultNHttpServerConnection#produceOutput Is there anyway I can tune the code to achieve my goal? Thanks Malaka -- Regards, *Malaka GallageSoftware Engineer* *AdroitLogic Lanka (Pvt) Ltd.* [image: Facebook] [image: Twitter] [image: LinkedIn] [image: Blogger] Skype : malaka.gallage Mobile : +94 718 796 378 --001a11493f2e5278d705126e3a15--