You have to close the stream before closing the connection:
tcpClient.GetStream().Close();
tcpClient.Close();
Closing the client does not close the stream.
More Related Contents:
- In C#, how to check if a TCP port is available?
- How to write a scalable TCP/IP based server
- Broken TCP messages
- Find the next TCP port in .NET
- Get Length of Data Available in NetworkStream
- Can you call Directory.GetFiles() with multiple filters?
- Easiest way to read from and write to files
- How to check for file lock? [duplicate]
- What is the ‘dynamic’ type in C# 4.0 used for?
- execute c# code at runtime from code file
- How can I run an EXE program from a Windows Service using C#?
- C# List Sort by x then y
- How do I fix a .NET windows application crashing at startup with Exception code: 0xE0434352?
- How do I restart a WPF application? [duplicate]
- Why Func instead of Predicate?
- Delegate caching behavior changes in Roslyn
- how to bind datatable to datagridview in c#
- How do I get the AM/PM value from a DateTime?
- xUnit.net: Global setup + teardown?
- How to catch exceptions from a ThreadPool.QueueUserWorkItem?
- Displaying a collection of controls in Windows Forms
- Use cookies from CookieContainer in WebBrowser
- Error” Parameter is not valid ” while converting Bytes into Image
- Show Loading animation during loading data in other thread
- Convert 2 dimensional array
- Generics can’t infer second parameter? [duplicate]
- Multiples Table in DataReader
- XmlSerializer property converter
- Limit only one session per user in ASP.NET
- How to receive event when user changes system’s culture