Bug 12012 - TcpClient.Close() doesn't work
Summary: TcpClient.Close() doesn't work
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-04-28 15:55 UTC by Gintas
Modified: 2017-08-28 15:02 UTC (History)
5 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Gintas 2013-04-28 15:55:44 UTC
It works perfectly fine(server notices when client disconnects) when launching it without Mono on Windows. When using Mono on Windows or Linux it just doesn't work, server doesn't notice that client disconnected.

TcpClient socket = new TcpClient();
NetworkStream stream = socket.GetStream();
// ...
stream.Close();
socket.Close();
Comment 1 Ashley 2013-09-20 20:24:35 UTC
I've observed that TcpClient also doesn't seem to notice when the server closes the connection from its end. Attempting to read or write from it eventually causes a timeout, but does not change the connected state or indicate that the connection has been lost.
Comment 2 leonardo.taglialegne 2014-09-15 04:40:16 UTC
I could reproduce this on mono 3.10.
If the server sends an RST the client doesn't notice that the connection is closed, and timeouts without setting Connected to false.
Comment 3 pr0vieh 2014-12-31 07:54:37 UTC
Confirmed!
it makes for a very bad network performance of mono
we need network performance!
I hope someone is looking at this soon
this bug is exist long enough...

Note You need to log in before you can comment on or make changes to this bug.