473,508 Members | 3,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Odd error in transport connection.

After six months flawless operation, I'm suddenly getting this error:
"Unable to read data from the transport connection." The code* hasn't
changed, and from what I can see, neither have the IP address, network
card, security protocols, etc. The code works fine on other machines,
but the critical one -- the one it's supposed to work on -- fails. The
stack trace** doesn't seem to help me out, but I thought perhaps someone
here could shed some light on where the problem might be occurring.

Thanks for any pointers!

--Brent

-------------------------------------------------------------

*Code:
=================================
HttpWebResponse oResponse = null;
HttpWebRequest oRequest = null;
Stream data = null;
StreamReader reader = null;

try
{
// Get HTML data
int tmp = ServicePointManager.DefaultConnectionLimit;
oRequest = (HttpWebRequest)WebRequest.Create(strURL);
oRequest.KeepAlive = false;
oRequest.Timeout = 10000; // 10 seconds
oRequest.UserAgent = "Web Client";
oResponse = (HttpWebResponse)oRequest.GetResponse();
if (oResponse.StatusCode == HttpStatusCode.OK)
{
data = oResponse.GetResponseStream();

reader = new StreamReader(data);

//Read from start the finish, line by line.
while ((thisRow = reader.ReadLine()) != null)
{
//do a bunch of stuff
}
}//end HttpWebResponse status code test
else
{
strError = "Bad HttpWebRequest status.";
}
reader.Close();
data.Close();
oResponse.Close();
}
catch(WebException e)
{
emit(e.Message + " Status: " + e.Status);
}
catch (Exception ex)
{
emit(ex.Message + "\n" + ex.StackTrace);
//ERROR IS CAUGHT HERE!
}
finally
{
if (reader != null){reader.Close();}
if(data != null){data.Close();}
if(oResponse != null){oResponse.Close();}
}
GC.Collect();

===============================

**Error & Stack Trace
===============================
Unable to read data from the transport connection
at System.Net.Sockets.NetworkStream.BeginRead(Byte[] buffer, Int32
offset, Int32 size, AsyncCallback callback, Object state)
at System.Net.Connection.BeginRead(Byte[] buffer, Int32 offset,
Int32 size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.InternalBeginRead(Int32 bytesToRead,
NestedSingleAsyncResult castedAsyncResult, Boolean fromCallback)
at System.Net.ConnectStream.BeginReadWithoutValidatio n(Byte[]
buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.BeginRead(Byte[] buffer, Int32 offset,
Int32 size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32
size)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadLine()
at nsImport13F.ImportThirteenF.writeHoldingstoDB(Stri ng strURL)" at
16:50:49
===============================
Jun 1 '06 #1
0 1305

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4179
by: Muscha | last post by:
Hello, Every now and then my application throw this exception: "Unable to read data from the transport connection" And when I break into the Visual Studio, the thread where it failed has...
2
3134
by: Latha Rajeev | last post by:
Hi, I have an application which sends out mails(using CDO), the SMTP Server being a machine which is one the same network. Most times, the mails are sent out successfully but every once in a...
7
9519
by: Alan Pretre | last post by:
I have an application installed at a customer site that has been getting a general network error for a couple of years. I was hoping that .NET 2.0 would clear it up, but unfortunately it didn't. ...
5
32731
by: Shilpa | last post by:
I am getting the following error. A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - The system cannot open the file.) On...
1
4001
by: Terrance | last post by:
I'm trying to create a small messenger program that uses the tcpclient and tcplistenter objects. When I start the application and run the thread that fires the tcplistener; once the client sends...
5
2474
by: Nathan Sokalski | last post by:
I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send() method. My code contains all of the following: Dim mailmsg As New Mail.MailMessage Mail.SmtpMail.SmtpServer =...
0
4547
by: palmem | last post by:
I am trying to write a simple FTP server in order to learn about sockets This is my first time trying sockets This code should take a connection on port 8110, dump it to a client "thread" (not...
2
6808
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how...
0
1284
by: louis08 | last post by:
When i connect to the server i get a BufferOverflowException, HELP!!!! This is where the error is thrown. final Transport transport = new TCPTransport(client);
0
7229
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7129
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5637
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3208
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
428
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.