Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 789F9200ACA for ; Thu, 9 Jun 2016 17:07:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7747D160A58; Thu, 9 Jun 2016 15:07:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C17E7160A29 for ; Thu, 9 Jun 2016 17:07:56 +0200 (CEST) Received: (qmail 79387 invoked by uid 500); 9 Jun 2016 15:07:56 -0000 Mailing-List: contact dev-help@reef.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@reef.apache.org Delivered-To: mailing list dev@reef.apache.org Received: (qmail 79375 invoked by uid 99); 9 Jun 2016 15:07:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2016 15:07:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 2825AC0EB4 for ; Thu, 9 Jun 2016 15:07:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.701 X-Spam-Level: X-Spam-Status: No, score=-0.701 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=weimo-de.20150623.gappssmtp.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 41W9T8qvAoUq for ; Thu, 9 Jun 2016 15:07:54 +0000 (UTC) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id A08055F2C5 for ; Thu, 9 Jun 2016 15:07:53 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id ec8so13682391pac.0 for ; Thu, 09 Jun 2016 08:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weimo-de.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=o5Y98Q7wC/UMmBC/LxvvOnNQQWV8O39jI9zCcesITXs=; b=k9zGhpTi3R4IkUoSnAQR483GA9d8qPpJbZAY8u0PEshqgZabdA6sAfrPCAYNEm4Sq/ CTE8xneq6k/kwx8uzama4tmhO2NyopSLV7uaxL6X68xKdwu07u3svE+Ep6NbfTIswRr+ Go1n102El1k2mejZzI97fy8FrQbyBgHLARb2twNg4hppsYxHWUj74bbHqN+CuZFJIBwq Jlr8qtv2ALXBQfTj/hy8FAEsLalebuva1D+cgjNQUsIOcIQlpOPyMXgwTUC92j6ybGpA Z1PzUacwnL4+cI2ji5mO+exosKE2rGZmPcbd8Fg7btcnmatQrBhUJysxKey+wSmFRW86 ufSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=o5Y98Q7wC/UMmBC/LxvvOnNQQWV8O39jI9zCcesITXs=; b=gygKQ1HVC9CzeytnCQjTtJj6EiFwpLXRh7mOO2gDXVxpwmGXmsbuYAPWgxhJ/ZVNCV t8EKpOxdXqZPpiVt2VI4ihjTELVi8L2o1pDjr9QC2H2OjTctBYD9IOZuNkvv+c7XUiGr cCt+kfVkv39gtgbG0UPgSyH/c+dTHJ0GVktj4TmVsdPGMI5L8jARL30gk1ipVq0BCYrW sLLCl/KK9qLKcNO3emg4B4Q4wfrR49KUVfjUrEy8Cj4knXaeBOfJJD5q8XSakngneEO9 IjikAO8z00VEiaRttz6jnvhsHCJT3MF+hXAlmEwN3TZ2k6CG3iZOf23Kch13zUENVBVm omvA== X-Gm-Message-State: ALyK8tLsJUVO4LTRlkvNfMYd9BjJSPJKAwG93vCO756P1Z4OJKzQy2BJEt73Utir0dgz0w== X-Received: by 10.66.231.68 with SMTP id te4mr12573603pac.16.1465484865843; Thu, 09 Jun 2016 08:07:45 -0700 (PDT) Received: from [10.5.50.160] ([50.251.238.98]) by smtp.gmail.com with ESMTPSA id 4sm10856154pfz.35.2016.06.09.08.07.45 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jun 2016 08:07:45 -0700 (PDT) Subject: Re: C# NetworkStream.close() behavior To: dev@reef.apache.org References: From: Markus Weimer Message-ID: <57598641.4040906@weimo.de> Date: Thu, 9 Jun 2016 08:07:45 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit archived-at: Thu, 09 Jun 2016 15:07:57 -0000 On 2016-06-08 18:24, Dhruv Mahajan wrote: > It seems that even of read==0, there are bytes left to read. My > understanding on reading the documentation was that no further data > is available since stream is closed. Any idea where am I going > wrong? The documentation[0] states: > Instead of calling this method, ensure that the stream is properly > disposed. So, you might want to use `.Dispose()` instead? Markus [0]: https://msdn.microsoft.com/en-us/library/system.net.sockets.networkstream.close%28v=vs.110%29.aspx