473,591 Members | 2,897 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unable to read data from the transport connection

Hi to all,

Im searching a hand to solve an Exception that i get when i try to give the
user to a gmail account...

Any help would be appreciated.. Thanks in advance

This is a piece of my code:

Server=new TcpClient("pop. gmail.com",995) ; //stablish a connection

Networkstream=S erver.GetStream ();//returns the first stream

Readerstream=ne w StreamReader(Se rver.GetStream( ));

username="xx*** ****@gmail.com" ;
string Data= "USER "+username + CRLF;
byte[] Data_ = System.Text.Enc oding.ASCII.Get Bytes(Data.ToCh arArray());
Networkstream.W rite(Data_,0,Da ta_.Length);
string temp=read_singl e_line_response ();
---------------------------
The stack trace is this:
---------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.IOExc eption: Unable to read data from the transport connection.
---> System.Net.Sock ets.SocketExcep tion: Se ha forzado la interrupción de una
conexión existente por el host remoto
at System.Net.Sock ets.Socket.Rece ive(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
at System.Net.Sock ets.NetworkStre am.Read(Byte[] buffer, Int32 offset,
Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sock ets.NetworkStre am.Read(Byte[] buffer, Int32 offset,
Int32 size)
at System.IO.Strea mReader.ReadBuf fer()
at System.IO.Strea mReader.ReadLin e()
at GmailParser.Ema iler.read_singl e_line_response () in c:\documents and
settings\alpha1 \escritorio\gma ilparsers\email er.cs:line 148
at GmailParser.Ema iler.USER() in c:\documents and
settings\alpha1 \escritorio\gma ilparsers\email er.cs:line 101
at GmailParser.Ema iler.Connect() in c:\documents and
settings\alpha1 \escritorio\gma ilparsers\email er.cs:line 50
at GmailParser.For m1.Form1_Load(O bject sender, EventArgs e) in
C:\Documents and Settings\Alpha1 \Escritorio\Gma ilParsers\Form1 .cs:line 78
at System.Windows. Forms.Form.OnLo ad(EventArgs e)
at System.Windows. Forms.Form.OnCr eateControl()
at System.Windows. Forms.Control.C reateControl(Bo olean fIgnoreVisible)
at System.Windows. Forms.Control.C reateControl()
at System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
GmailParser
Assembly Version: 1.0.2173.39969
Win32 Version: 1.0.2173.39969
CodeBase:
file:///C:/Documents%20and %20Settings/Alpha1/Escritorio/GmailParsers/bin/Debug/GmailParser.exe
----------------------------------------
System.Windows. Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.windows. forms/1.0.5000.0__b77 a5c561934e089/system.windows. forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system/1.0.5000.0__b77 a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.drawing/1.0.5000.0__b03 f5f7f11d50a3a/system.drawing. dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.xml/1.0.5000.0__b77 a5c561934e089/system.xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config ) must have the
jitDebugging value set in the system.windows. forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuratio n>
<system.windows .forms jitDebugging="t rue" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
--
Thanks
Regards.
Josema
Dec 13 '05 #1
4 12118
you can check stream CanRead property before reading from it
why do you create StreamReader? you can read directly from network stream

Also notice that StreamReader is inherited from TextReader and NetworkStream
from Stream

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

"Josema" <Je******@ocu.o rg> wrote in message
news:4D******** *************** ***********@mic rosoft.com...
Hi to all,

Im searching a hand to solve an Exception that i get when i try to give
the
user to a gmail account...

Any help would be appreciated.. Thanks in advance

This is a piece of my code:

Server=new TcpClient("pop. gmail.com",995) ; //stablish a connection

Networkstream=S erver.GetStream ();//returns the first stream

Readerstream=ne w StreamReader(Se rver.GetStream( ));

username="xx*** ****@gmail.com" ;
string Data= "USER "+username + CRLF;
byte[] Data_ =
System.Text.Enc oding.ASCII.Get Bytes(Data.ToCh arArray());
Networkstream.W rite(Data_,0,Da ta_.Length);
string temp=read_singl e_line_response ();
---------------------------
The stack trace is this:
---------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.IOExc eption: Unable to read data from the transport connection.
---> System.Net.Sock ets.SocketExcep tion: Se ha forzado la interrupcion de
una
conexion existente por el host remoto
at System.Net.Sock ets.Socket.Rece ive(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
at System.Net.Sock ets.NetworkStre am.Read(Byte[] buffer, Int32 offset,
Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sock ets.NetworkStre am.Read(Byte[] buffer, Int32 offset,
Int32 size)
at System.IO.Strea mReader.ReadBuf fer()
at System.IO.Strea mReader.ReadLin e()
at GmailParser.Ema iler.read_singl e_line_response () in c:\documents and
settings\alpha1 \escritorio\gma ilparsers\email er.cs:line 148
at GmailParser.Ema iler.USER() in c:\documents and
settings\alpha1 \escritorio\gma ilparsers\email er.cs:line 101
at GmailParser.Ema iler.Connect() in c:\documents and
settings\alpha1 \escritorio\gma ilparsers\email er.cs:line 50
at GmailParser.For m1.Form1_Load(O bject sender, EventArgs e) in
C:\Documents and Settings\Alpha1 \Escritorio\Gma ilParsers\Form1 .cs:line 78
at System.Windows. Forms.Form.OnLo ad(EventArgs e)
at System.Windows. Forms.Form.OnCr eateControl()
at System.Windows. Forms.Control.C reateControl(Bo olean fIgnoreVisible)
at System.Windows. Forms.Control.C reateControl()
at System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
GmailParser
Assembly Version: 1.0.2173.39969
Win32 Version: 1.0.2173.39969
CodeBase:
file:///C:/Documents%20and %20Settings/Alpha1/Escritorio/GmailParsers/bin/Debug/GmailParser.exe
----------------------------------------
System.Windows. Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.windows. forms/1.0.5000.0__b77 a5c561934e089/system.windows. forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system/1.0.5000.0__b77 a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.drawing/1.0.5000.0__b03 f5f7f11d50a3a/system.drawing. dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.xml/1.0.5000.0__b77 a5c561934e089/system.xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config ) must have the
jitDebugging value set in the system.windows. forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuratio n>
<system.windows .forms jitDebugging="t rue" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
--
Thanks
Regards.
Josema

Dec 13 '05 #2
port 995 for POP3 Gmail is using SSL. I hope thats not causing the
issue.

Dec 14 '05 #3
Thanks a lot Vadym, i will try first to use only Network Stream, and the Can
Read property...

--
Thanks
Regards.
Josema
"Vadym Stetsyak" wrote:
you can check stream CanRead property before reading from it
why do you create StreamReader? you can read directly from network stream

Also notice that StreamReader is inherited from TextReader and NetworkStream
from Stream

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

"Josema" <Je******@ocu.o rg> wrote in message
news:4D******** *************** ***********@mic rosoft.com...
Hi to all,

Im searching a hand to solve an Exception that i get when i try to give
the
user to a gmail account...

Any help would be appreciated.. Thanks in advance

This is a piece of my code:

Server=new TcpClient("pop. gmail.com",995) ; //stablish a connection

Networkstream=S erver.GetStream ();//returns the first stream

Readerstream=ne w StreamReader(Se rver.GetStream( ));

username="xx*** ****@gmail.com" ;
string Data= "USER "+username + CRLF;
byte[] Data_ =
System.Text.Enc oding.ASCII.Get Bytes(Data.ToCh arArray());
Networkstream.W rite(Data_,0,Da ta_.Length);
string temp=read_singl e_line_response ();
---------------------------
The stack trace is this:
---------------------------
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.IOExc eption: Unable to read data from the transport connection.
---> System.Net.Sock ets.SocketExcep tion: Se ha forzado la interrupcion de
una
conexion existente por el host remoto
at System.Net.Sock ets.Socket.Rece ive(Byte[] buffer, Int32 offset, Int32
size, SocketFlags socketFlags)
at System.Net.Sock ets.NetworkStre am.Read(Byte[] buffer, Int32 offset,
Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sock ets.NetworkStre am.Read(Byte[] buffer, Int32 offset,
Int32 size)
at System.IO.Strea mReader.ReadBuf fer()
at System.IO.Strea mReader.ReadLin e()
at GmailParser.Ema iler.read_singl e_line_response () in c:\documents and
settings\alpha1 \escritorio\gma ilparsers\email er.cs:line 148
at GmailParser.Ema iler.USER() in c:\documents and
settings\alpha1 \escritorio\gma ilparsers\email er.cs:line 101
at GmailParser.Ema iler.Connect() in c:\documents and
settings\alpha1 \escritorio\gma ilparsers\email er.cs:line 50
at GmailParser.For m1.Form1_Load(O bject sender, EventArgs e) in
C:\Documents and Settings\Alpha1 \Escritorio\Gma ilParsers\Form1 .cs:line 78
at System.Windows. Forms.Form.OnLo ad(EventArgs e)
at System.Windows. Forms.Form.OnCr eateControl()
at System.Windows. Forms.Control.C reateControl(Bo olean fIgnoreVisible)
at System.Windows. Forms.Control.C reateControl()
at System.Windows. Forms.Control.W mShowWindow(Mes sage& m)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.Scrollabl eControl.WndPro c(Message& m)
at System.Windows. Forms.Container Control.WndProc (Message& m)
at System.Windows. Forms.Form.WmSh owWindow(Messag e& m)
at System.Windows. Forms.Form.WndP roc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.Callback(In tPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
GmailParser
Assembly Version: 1.0.2173.39969
Win32 Version: 1.0.2173.39969
CodeBase:
file:///C:/Documents%20and %20Settings/Alpha1/Escritorio/GmailParsers/bin/Debug/GmailParser.exe
----------------------------------------
System.Windows. Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.windows. forms/1.0.5000.0__b77 a5c561934e089/system.windows. forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system/1.0.5000.0__b77 a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.drawing/1.0.5000.0__b03 f5f7f11d50a3a/system.drawing. dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/windowss/assembly/gac/system.xml/1.0.5000.0__b77 a5c561934e089/system.xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config ) must have the
jitDebugging value set in the system.windows. forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuratio n>
<system.windows .forms jitDebugging="t rue" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
--
Thanks
Regards.
Josema


Dec 14 '05 #4
Hi tdavisjr,

I only found in this url
(http://mail.google.com/support/bin/a...y?answer=13276) the port 995 for
the pop3....

Yes, as you say is for SSL, but what do you think about which port may i
use, to do that?? Do you know the number?

--
Thanks
Regards.
Josema
"tdavisjr" wrote:
port 995 for POP3 Gmail is using SSL. I hope thats not causing the
issue.

Dec 14 '05 #5

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

Similar topics

4
4419
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big strings' instead of 'one liners' I check the streams for terminators. I'm having problems with the connection, I've been looking and debugging for 2 weeks now (debugging with an emulator is terribly slow..) but I'm not getting it...
0
9967
by: Steve - DND | last post by:
We are continually receiving timeout, and "Unable to write data to the transport connection" errors while using the System.Net.HttpWebRequest class from an ASP.Net web page. Below are the two errors we continue to receive: Source: System Message: The operation has timed-out. Target Function: System.Net.WebResponse GetResponse()
1
4183
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 none of my code and the following is the call stack:
0
11237
by: Aryeh Holzer | last post by:
Hi, I've been trying to use the weather webservice available from the National Weather Service (NWS), at http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML. wsdl without success. Here's what I've found so far. When I use .NET 1.0/1.1, and try to call the primary webservice method NDFDgen, the call will succeed if the productType is set to "glance", but fail if set to "time- series".
0
679
by: Arno | last post by:
Hi, I've written a class for client-socket connection, but I get a lot of times the error message "Unable to read data from the transport connection" when restart reading the stream with socket.BeginRead in the Sub SocketIncomingMsg. I'm debugging now for weeks, but I can't detect where it's going wrong. the part of code where it fails:
1
4018
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 data then closes the stream and the connection I receive the message Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. How can I keep the connection listener listening for new traffic?...
0
789
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
3
14046
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
7
3088
by: Jay Balapa | last post by:
Hello, We have a Pocket PC client application which just connects to our webservice. When a client connects his Pocket PC through his WIFI he gets the following- Unable to read data from the transport connection . I have the same setup and am unable to reproduce this problem. This method just tests the webmethod with a helloworld returned. Any help is greatly appreciated.
6
8152
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql server mobile ce database. Until recently I was synching everything thru a com port serial cable. The devices would connect to the computer thru activesync and are able to acquire an internet connection. The sync for the program occurs thru a website...
0
7870
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8225
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6639
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5732
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5400
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3891
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2378
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 we have to send another system
1
1465
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.