Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9124219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:31:27+00:00 2026-06-17T06:31:27+00:00

When attempting to download data from a server using StreamSocket , I encounter an

  • 0

When attempting to download data from a server using StreamSocket, I encounter an error:

An existing connection was forcibly closed

I use a StreamReader to read data from InputStream.AsStreamForRead().

Strangely, this works fine for the first message I download, but throws the above exception for the next message.

The error doesn’t happen immediately, it does manage to read most of the message, but at some point it blocks on sr.ReadLine() and then an exception is thrown. See snippet below:

while (true)
{
    str = sr.ReadLine();
    if (str != ".")
    {
        if (str.StartsWith(@".."))
            sb.Append(str.Substring(1) + "\r\n");
        else
            sb.Append(str + "\r\n");
    }
    else break;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:31:28+00:00Added an answer on June 17, 2026 at 6:31 am

    As it turns out, there was nothing wrong with my code.

    My USB dongle modem, kept dropping the connection which resulted in the issue above.

    Tested this over a couple of different connections and all is fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to use the data series from this example no longer passes the JSONLint
I am attempting to download a gunzipped file from an FTP server. It appears
I am attempting to create a radar animation using data from the National Weather
I need to download data from the Bureau of Labor Statistics' public FTP server
I'm attempting to pull in data from Google's Shopping API. I'm able to download
I am using centOS 5 server. i got the error while i was attempting
I'm currently using a HttpResponse to download files from my Server. I already have
I am attempting to download a file from a web server e.g. http://web.server.com/getfile=2 Now
I'm attempting to use wget with the -p option to download specific documents and
I am attempting to download fairly large files (up to, possibly over 1GB) from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.